aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-live.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2011-01-20 16:56:25 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2011-01-20 16:56:25 +0000
commit427f6cec9c82ea688d821fd2e8d05197d8a1792f (patch)
tree14a8302aec3d91db81012ed7e00e5de1ecf7e409 /gcc/tree-ssa-live.c
parent583ac69ceb5c573aa3fd016f209f222b8ad704cb (diff)
downloadgcc-427f6cec9c82ea688d821fd2e8d05197d8a1792f.zip
gcc-427f6cec9c82ea688d821fd2e8d05197d8a1792f.tar.gz
gcc-427f6cec9c82ea688d821fd2e8d05197d8a1792f.tar.bz2
re PR tree-optimization/46583 (-fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone)
gcc/ChangeLog: PR debug/46583 * tree-ssa-live.c (remove_unused_scope_block_p): Keep type decls. gcc/testsuite/ChangeLog: PR debug/46583 * g++.dg/debug/pr46583.C: New. From-SVN: r169058
Diffstat (limited to 'gcc/tree-ssa-live.c')
-rw-r--r--gcc/tree-ssa-live.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 7a6cafa..0fa906b 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -490,11 +490,16 @@ remove_unused_scope_block_p (tree scope)
can be considered dead. We only want to keep around blocks user can
breakpoint into and ask about value of optimized out variables.
- Similarly we need to keep around types at least until all variables of
- all nested blocks are gone. We track no information on whether given
- type is used or not. */
-
- else if (debug_info_level == DINFO_LEVEL_NORMAL
+ Similarly we need to keep around types at least until all
+ variables of all nested blocks are gone. We track no
+ information on whether given type is used or not, so we have
+ to keep them even when not emitting debug information,
+ otherwise we may end up remapping variables and their (local)
+ types in different orders depending on whether debug
+ information is being generated. */
+
+ else if (TREE_CODE (*t) == TYPE_DECL
+ || debug_info_level == DINFO_LEVEL_NORMAL
|| debug_info_level == DINFO_LEVEL_VERBOSE)
;
else