Commit 1b9a784a by Alexandre Oliva Committed by Alexandre Oliva

re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining…

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
parent 27c6b086
...@@ -2,6 +2,24 @@ ...@@ -2,6 +2,24 @@
PR debug/47106 PR debug/47106
PR debug/47402 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
PR debug/47402
* tree-flow.h (referenced_var_lookup): Add fn parameter. * tree-flow.h (referenced_var_lookup): Add fn parameter.
Adjust all callers. Adjust all callers.
* tree-dfa.c (referenced_var_lookup): Use fn instead of cfun. * tree-dfa.c (referenced_var_lookup): Use fn instead of cfun.
......
...@@ -2712,7 +2712,7 @@ create_new_local_vars (void) ...@@ -2712,7 +2712,7 @@ create_new_local_vars (void)
new_local_vars = htab_create (num_referenced_vars, new_local_vars = htab_create (num_referenced_vars,
new_var_hash, new_var_eq, NULL); 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)) if (!is_global_var (var))
create_new_var (var, new_local_vars); create_new_var (var, new_local_vars);
......
...@@ -218,7 +218,7 @@ dump_referenced_vars (FILE *file) ...@@ -218,7 +218,7 @@ dump_referenced_vars (FILE *file)
fprintf (file, "\nReferenced variables in %s: %u\n\n", fprintf (file, "\nReferenced variables in %s: %u\n\n",
get_name (current_function_decl), (unsigned) num_referenced_vars); 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: "); fprintf (file, "Variable: ");
dump_variable (file, var); dump_variable (file, var);
...@@ -400,7 +400,7 @@ collect_dfa_stats (struct dfa_stats_d *dfa_stats_p ATTRIBUTE_UNUSED) ...@@ -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)); memset ((void *)dfa_stats_p, 0, sizeof (struct dfa_stats_d));
/* Count all the variable annotations. */ /* Count all the variable annotations. */
FOR_EACH_REFERENCED_VAR (var, vi) FOR_EACH_REFERENCED_VAR (cfun, var, vi)
if (var_ann (var)) if (var_ann (var))
dfa_stats_p->num_var_anns++; dfa_stats_p->num_var_anns++;
......
...@@ -112,10 +112,10 @@ referenced_var (unsigned int uid) ...@@ -112,10 +112,10 @@ referenced_var (unsigned int uid)
referenced_vars hashtable, and return that variable. */ referenced_vars hashtable, and return that variable. */
static inline tree 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, 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 /* Return true if we have hit the end of the referenced variables ITER is
......
...@@ -314,9 +314,9 @@ typedef struct ...@@ -314,9 +314,9 @@ typedef struct
to the hashtable while using this macro. Doing so may cause it to behave to the hashtable while using this macro. Doing so may cause it to behave
erratically. */ erratically. */
#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \ #define FOR_EACH_REFERENCED_VAR(FN, VAR, ITER) \
for ((VAR) = first_referenced_var (&(ITER)); \ for ((VAR) = first_referenced_var ((FN), &(ITER)); \
!end_referenced_vars_p (&(ITER)); \ !end_referenced_vars_p (&(ITER)); \
(VAR) = next_referenced_var (&(ITER))) (VAR) = next_referenced_var (&(ITER)))
extern tree referenced_var_lookup (struct function *, unsigned int); extern tree referenced_var_lookup (struct function *, unsigned int);
......
...@@ -1156,7 +1156,7 @@ insert_phi_nodes (bitmap_head *dfs) ...@@ -1156,7 +1156,7 @@ insert_phi_nodes (bitmap_head *dfs)
differences but no UID ordering differences. */ differences but no UID ordering differences. */
vars = BITMAP_ALLOC (NULL); vars = BITMAP_ALLOC (NULL);
FOR_EACH_REFERENCED_VAR (var, rvi) FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{ {
struct def_blocks_d *def_map; struct def_blocks_d *def_map;
...@@ -1573,7 +1573,7 @@ dump_currdefs (FILE *file) ...@@ -1573,7 +1573,7 @@ dump_currdefs (FILE *file)
tree var; tree var;
fprintf (file, "\n\nCurrent reaching definitions\n\n"); 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 if (SYMS_TO_RENAME (cfun) == NULL
|| bitmap_bit_p (SYMS_TO_RENAME (cfun), DECL_UID (var))) || bitmap_bit_p (SYMS_TO_RENAME (cfun), DECL_UID (var)))
{ {
...@@ -2313,7 +2313,7 @@ init_ssa_renamer (void) ...@@ -2313,7 +2313,7 @@ init_ssa_renamer (void)
def_blocks = htab_create (num_referenced_vars, def_blocks_hash, def_blocks = htab_create (num_referenced_vars, def_blocks_hash,
def_blocks_eq, def_blocks_free); 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); set_current_def (var, NULL_TREE);
} }
......
...@@ -1540,7 +1540,7 @@ find_var_candidates (void) ...@@ -1540,7 +1540,7 @@ find_var_candidates (void)
referenced_var_iterator rvi; referenced_var_iterator rvi;
bool ret = false; 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) if (TREE_CODE (var) != VAR_DECL && TREE_CODE (var) != PARM_DECL)
continue; continue;
......
...@@ -364,7 +364,7 @@ dump_alias_info (FILE *file) ...@@ -364,7 +364,7 @@ dump_alias_info (FILE *file)
fprintf (file, "Aliased symbols\n\n"); fprintf (file, "Aliased symbols\n\n");
FOR_EACH_REFERENCED_VAR (var, rvi) FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{ {
if (may_be_aliased (var)) if (may_be_aliased (var))
dump_variable (file, var); dump_variable (file, var);
......
...@@ -705,7 +705,7 @@ remove_unused_locals (void) ...@@ -705,7 +705,7 @@ remove_unused_locals (void)
mark_scope_block_unused (DECL_INITIAL (current_function_decl)); mark_scope_block_unused (DECL_INITIAL (current_function_decl));
/* Assume all locals are unused. */ /* Assume all locals are unused. */
FOR_EACH_REFERENCED_VAR (t, rvi) FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
clear_is_used (t); clear_is_used (t);
/* Walk the CFG marking all referenced symbols. */ /* Walk the CFG marking all referenced symbols. */
...@@ -821,7 +821,7 @@ remove_unused_locals (void) ...@@ -821,7 +821,7 @@ remove_unused_locals (void)
} }
/* Remove unused variables from REFERENCED_VARs. */ /* Remove unused variables from REFERENCED_VARs. */
FOR_EACH_REFERENCED_VAR (t, rvi) FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
if (!is_global_var (t) if (!is_global_var (t)
&& TREE_CODE (t) != PARM_DECL && TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL && TREE_CODE (t) != RESULT_DECL
......
...@@ -1157,7 +1157,7 @@ delete_tree_ssa (void) ...@@ -1157,7 +1157,7 @@ delete_tree_ssa (void)
tree var; tree var;
/* Remove annotations from every referenced local variable. */ /* 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)) if (is_global_var (var))
continue; continue;
......
...@@ -340,7 +340,7 @@ release_dead_ssa_names (void) ...@@ -340,7 +340,7 @@ release_dead_ssa_names (void)
/* Current defs point to various dead SSA names that in turn point to /* Current defs point to various dead SSA names that in turn point to
eventually dead variables so a bunch of memory is held live. */ 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); set_current_def (t, NULL);
/* Now release the freelist. */ /* Now release the freelist. */
for (t = FREE_SSANAMES (cfun); t; t = next) for (t = FREE_SSANAMES (cfun); t; t = next)
......
...@@ -481,7 +481,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret) ...@@ -481,7 +481,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
/* Make sure the tail invocation of this function does not refer /* Make sure the tail invocation of this function does not refer
to local variables. */ to local variables. */
FOR_EACH_REFERENCED_VAR (var, rvi) FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{ {
if (TREE_CODE (var) != PARM_DECL if (TREE_CODE (var) != PARM_DECL
&& auto_var_in_fn_p (var, cfun->decl) && auto_var_in_fn_p (var, cfun->decl)
...@@ -889,7 +889,7 @@ add_virtual_phis (void) ...@@ -889,7 +889,7 @@ add_virtual_phis (void)
this, we cannot do much better than to rebuild the ssa form for this, we cannot do much better than to rebuild the ssa form for
possibly affected virtual ssa names from scratch. */ 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) if (!is_gimple_reg (var) && gimple_default_def (cfun, var) != NULL_TREE)
mark_sym_for_renaming (var); mark_sym_for_renaming (var);
......
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