summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-live.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-20 16:56:25 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-20 16:56:25 +0000
commit29bcbc13ca1e62bfdd8fa7b9914c2a9978dddb32 (patch)
tree14a8302aec3d91db81012ed7e00e5de1ecf7e409 /gcc/tree-ssa-live.c
parentf87ea39e0190cbc279e888dd9e8290abe5f7f907 (diff)
downloadgcc-29bcbc13ca1e62bfdd8fa7b9914c2a9978dddb32.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169058 138bc75d-0d04-0410-961f-82ee72b054a4
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 7a6cafa0d28..0fa906b79c7 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