Commit ccf134c7 by Richard Guenther Committed by Joern Rennecke

re PR debug/44832 (-fcompare-debug failure for C++ i386.c)

2010-07-10  Richard Guenther  <rguenther@suse.de>
	    Joern Rennecke  <joern.rennecke@embecosm.com>

	PR debug/44832
	* tree-ssa-live.c (mark_all_vars_used_1): Set TREE_USED for
	LABEL_DECL.
	(remove_unused_scope_block_p): Don't drop TREE_USED LABEL_DECLs
	unless they have DECL_IGNORED_P set.

Co-Authored-By: Joern Rennecke <joern.rennecke@embecosm.com>

From-SVN: r162035
parent bcee752e
2010-07-10 Richard Guenther <rguenther@suse.de> 2010-07-10 Richard Guenther <rguenther@suse.de>
Joern Rennecke <joern.rennecke@embecosm.com>
PR debug/44832
* tree-ssa-live.c (mark_all_vars_used_1): Set TREE_USED for
LABEL_DECL.
(remove_unused_scope_block_p): Don't drop TREE_USED LABEL_DECLs
unless they have DECL_IGNORED_P set.
2010-07-10 Richard Guenther <rguenther@suse.de>
PR lto/44889 PR lto/44889
* gimple.c (gimple_fixup_complete_and_incomplete_subtype_p): New * gimple.c (gimple_fixup_complete_and_incomplete_subtype_p): New
......
...@@ -383,6 +383,14 @@ mark_all_vars_used_1 (tree *tp, int *walk_subtrees, void *data) ...@@ -383,6 +383,14 @@ mark_all_vars_used_1 (tree *tp, int *walk_subtrees, void *data)
} }
set_is_used (t); set_is_used (t);
} }
/* remove_unused_scope_block_p requires information about labels
which are not DECL_IGNORED_P to tell if they might be used in the IL. */
if (TREE_CODE (t) == LABEL_DECL)
/* Although the TREE_USED values that the frontend uses would be
acceptable (albeit slightly over-conservative) for our purposes,
init_vars_expansion clears TREE_USED for LABEL_DECLs too, so we
must re-compute it here. */
TREE_USED (t) = 1;
if (IS_TYPE_OR_DECL_P (t)) if (IS_TYPE_OR_DECL_P (t))
*walk_subtrees = 0; *walk_subtrees = 0;
...@@ -462,6 +470,19 @@ remove_unused_scope_block_p (tree scope) ...@@ -462,6 +470,19 @@ remove_unused_scope_block_p (tree scope)
else if ((ann = var_ann (*t)) != NULL else if ((ann = var_ann (*t)) != NULL
&& ann->used) && ann->used)
unused = false; unused = false;
else if (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))
/* For labels that are still used in the IL, the decision to
preserve them must not depend DEBUG_INFO_LEVEL, otherwise we
risk having different ordering in debug vs. non-debug builds
during inlining or versioning.
A label appearing here (we have already checked DECL_IGNORED_P)
should not be used in the IL unless it has been explicitly used
before, so we use TREE_USED as an approximation. */
/* In principle, we should do the same here as for the debug case
below, however, when debugging, there might be additional nested
levels that keep an upper level with a label live, so we have to
force this block to be considered used, too. */
unused = false;
/* When we are not doing full debug info, we however can keep around /* When we are not doing full debug info, we however can keep around
only the used variables for cfgexpand's memory packing saving quite only the used variables for cfgexpand's memory packing saving quite
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment