diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-03-17 18:53:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-03-17 18:53:01 +0100 |
commit | df5deb18f15b3fad7e8cd7e1af71c9c52fb1cd7a (patch) | |
tree | 1b15f4c8cf7e3ebd1f8a9f62640f61f298f60849 | |
parent | 47512a6e9deb02e7f81311de32fa3a9a06b94bae (diff) | |
download | gcc-df5deb18f15b3fad7e8cd7e1af71c9c52fb1cd7a.zip gcc-df5deb18f15b3fad7e8cd7e1af71c9c52fb1cd7a.tar.gz gcc-df5deb18f15b3fad7e8cd7e1af71c9c52fb1cd7a.tar.bz2 |
re PR debug/39474 (DW_AT_location missing for unused variables even at -O0)
PR debug/39474
* tree-ssa-live.c (remove_unused_locals): Don't remove local
unused non-artificial variables when not optimizing.
From-SVN: r144914
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/tree-ssa-live.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fae65db..8e5fa32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,10 @@ * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL. + PR debug/39474 + * tree-ssa-live.c (remove_unused_locals): Don't remove local + unused non-artificial variables when not optimizing. + PR debug/39471 * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit DW_TAG_imported_module even if decl is IMPORTED_DECL with diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index 28a829c..5731964 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -740,7 +740,8 @@ remove_unused_locals (void) if (TREE_CODE (var) != FUNCTION_DECL && (!(ann = var_ann (var)) - || !ann->used)) + || !ann->used) + && (optimize || DECL_ARTIFICIAL (var))) { if (is_global_var (var)) { @@ -781,8 +782,7 @@ remove_unused_locals (void) if (TREE_CODE (var) == VAR_DECL && is_global_var (var) - && bitmap_bit_p (global_unused_vars, DECL_UID (var)) - && (optimize || DECL_ARTIFICIAL (var))) + && bitmap_bit_p (global_unused_vars, DECL_UID (var))) *cell = TREE_CHAIN (*cell); else cell = &TREE_CHAIN (*cell); |