re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining -flto -fconserve-stack)

PR debug/47106
PR debug/47402
* tree-flow.h (FOR_EACH_REFERENCED_VAR): Add FN argument.
Adjust all users.  Pass FN to...
* tree-flow-inline.h (first_referenced_var): ... this.  Add
fn argument.
* ipa-struct-reorg.c: Adjust.
* tree-dfa.c: Adjust.
* tree-into-ssa.c: Adjust.
* tree-sra.c: Adjust.
* tree-ssa-alias.c: Adjust.
* tree-ssa-live.c: Adjust.
* tree-ssa.c: Adjust.
* tree-ssanames.c: Adjust.
* tree-tailcall.c: Adjust.

From-SVN: r170186
This commit is contained in:
Alexandre Oliva 2011-02-15 18:36:31 +00:00 committed by Alexandre Oliva
parent 27c6b08686
commit 1b9a784a89
12 changed files with 37 additions and 19 deletions

View File

@ -1,3 +1,21 @@
2011-02-15 Alexandre Oliva <aoliva@redhat.com>
PR debug/47106
PR debug/47402
* tree-flow.h (FOR_EACH_REFERENCED_VAR): Add FN argument.
Adjust all users. Pass FN to...
* tree-flow-inline.h (first_referenced_var): ... this. Add
fn argument.
* ipa-struct-reorg.c: Adjust.
* tree-dfa.c: Adjust.
* tree-into-ssa.c: Adjust.
* tree-sra.c: Adjust.
* tree-ssa-alias.c: Adjust.
* tree-ssa-live.c: Adjust.
* tree-ssa.c: Adjust.
* tree-ssanames.c: Adjust.
* tree-tailcall.c: Adjust.
2011-02-15 Alexandre Oliva <aoliva@redhat.com>
PR debug/47106

View File

@ -2712,7 +2712,7 @@ create_new_local_vars (void)
new_local_vars = htab_create (num_referenced_vars,
new_var_hash, new_var_eq, NULL);
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (!is_global_var (var))
create_new_var (var, new_local_vars);

View File

@ -218,7 +218,7 @@ dump_referenced_vars (FILE *file)
fprintf (file, "\nReferenced variables in %s: %u\n\n",
get_name (current_function_decl), (unsigned) num_referenced_vars);
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
fprintf (file, "Variable: ");
dump_variable (file, var);
@ -400,7 +400,7 @@ collect_dfa_stats (struct dfa_stats_d *dfa_stats_p ATTRIBUTE_UNUSED)
memset ((void *)dfa_stats_p, 0, sizeof (struct dfa_stats_d));
/* Count all the variable annotations. */
FOR_EACH_REFERENCED_VAR (var, vi)
FOR_EACH_REFERENCED_VAR (cfun, var, vi)
if (var_ann (var))
dfa_stats_p->num_var_anns++;

View File

@ -112,10 +112,10 @@ referenced_var (unsigned int uid)
referenced_vars hashtable, and return that variable. */
static inline tree
first_referenced_var (referenced_var_iterator *iter)
first_referenced_var (struct function *fn, referenced_var_iterator *iter)
{
return (tree) first_htab_element (&iter->hti,
gimple_referenced_vars (cfun));
gimple_referenced_vars (fn));
}
/* Return true if we have hit the end of the referenced variables ITER is

View File

@ -314,9 +314,9 @@ typedef struct
to the hashtable while using this macro. Doing so may cause it to behave
erratically. */
#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
for ((VAR) = first_referenced_var (&(ITER)); \
!end_referenced_vars_p (&(ITER)); \
#define FOR_EACH_REFERENCED_VAR(FN, VAR, ITER) \
for ((VAR) = first_referenced_var ((FN), &(ITER)); \
!end_referenced_vars_p (&(ITER)); \
(VAR) = next_referenced_var (&(ITER)))
extern tree referenced_var_lookup (struct function *, unsigned int);

View File

@ -1156,7 +1156,7 @@ insert_phi_nodes (bitmap_head *dfs)
differences but no UID ordering differences. */
vars = BITMAP_ALLOC (NULL);
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
struct def_blocks_d *def_map;
@ -1573,7 +1573,7 @@ dump_currdefs (FILE *file)
tree var;
fprintf (file, "\n\nCurrent reaching definitions\n\n");
FOR_EACH_REFERENCED_VAR (var, i)
FOR_EACH_REFERENCED_VAR (cfun, var, i)
if (SYMS_TO_RENAME (cfun) == NULL
|| bitmap_bit_p (SYMS_TO_RENAME (cfun), DECL_UID (var)))
{
@ -2313,7 +2313,7 @@ init_ssa_renamer (void)
def_blocks = htab_create (num_referenced_vars, def_blocks_hash,
def_blocks_eq, def_blocks_free);
FOR_EACH_REFERENCED_VAR(var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
set_current_def (var, NULL_TREE);
}

View File

@ -1540,7 +1540,7 @@ find_var_candidates (void)
referenced_var_iterator rvi;
bool ret = false;
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (TREE_CODE (var) != VAR_DECL && TREE_CODE (var) != PARM_DECL)
continue;

View File

@ -364,7 +364,7 @@ dump_alias_info (FILE *file)
fprintf (file, "Aliased symbols\n\n");
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (may_be_aliased (var))
dump_variable (file, var);

View File

@ -705,7 +705,7 @@ remove_unused_locals (void)
mark_scope_block_unused (DECL_INITIAL (current_function_decl));
/* Assume all locals are unused. */
FOR_EACH_REFERENCED_VAR (t, rvi)
FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
clear_is_used (t);
/* Walk the CFG marking all referenced symbols. */
@ -821,7 +821,7 @@ remove_unused_locals (void)
}
/* Remove unused variables from REFERENCED_VARs. */
FOR_EACH_REFERENCED_VAR (t, rvi)
FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
if (!is_global_var (t)
&& TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL

View File

@ -1157,7 +1157,7 @@ delete_tree_ssa (void)
tree var;
/* Remove annotations from every referenced local variable. */
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (is_global_var (var))
continue;

View File

@ -340,7 +340,7 @@ release_dead_ssa_names (void)
/* Current defs point to various dead SSA names that in turn point to
eventually dead variables so a bunch of memory is held live. */
FOR_EACH_REFERENCED_VAR (t, rvi)
FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
set_current_def (t, NULL);
/* Now release the freelist. */
for (t = FREE_SSANAMES (cfun); t; t = next)

View File

@ -481,7 +481,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
/* Make sure the tail invocation of this function does not refer
to local variables. */
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (TREE_CODE (var) != PARM_DECL
&& auto_var_in_fn_p (var, cfun->decl)
@ -889,7 +889,7 @@ add_virtual_phis (void)
this, we cannot do much better than to rebuild the ssa form for
possibly affected virtual ssa names from scratch. */
FOR_EACH_REFERENCED_VAR (var, rvi)
FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (!is_gimple_reg (var) && gimple_default_def (cfun, var) != NULL_TREE)
mark_sym_for_renaming (var);