mirror of git://gcc.gnu.org/git/gcc.git
tree-flow.h (execute_update_addresses_taken): Adjust.
* tree-flow.h (execute_update_addresses_taken): Adjust. * tree-ssa.c (maybe_optimize_var): Tweak comment and dump messages. (execute_update_addresses_taken): Remove parameter and OPTIMIZE test. * passes.c (execute_function_todo): Adjust calls to above function. From-SVN: r164571
This commit is contained in:
parent
962b8a0e7e
commit
f61c8291cb
|
|
@ -1,3 +1,10 @@
|
|||
2010-09-23 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* tree-flow.h (execute_update_addresses_taken): Adjust.
|
||||
* tree-ssa.c (maybe_optimize_var): Tweak comment and dump messages.
|
||||
(execute_update_addresses_taken): Remove parameter and OPTIMIZE test.
|
||||
* passes.c (execute_function_todo): Adjust calls to above function.
|
||||
|
||||
2010-09-23 Anatoly Sokolov <aesok@post.ru>
|
||||
|
||||
* config/arm/arm.h (OUTPUT_ADDR_CONST_EXTRA): Remove.
|
||||
|
|
|
|||
|
|
@ -1206,15 +1206,13 @@ execute_function_todo (void *data)
|
|||
cfun->last_verified &= ~TODO_verify_ssa;
|
||||
}
|
||||
|
||||
if (flags & TODO_update_address_taken)
|
||||
execute_update_addresses_taken (true);
|
||||
|
||||
if (flags & TODO_rebuild_alias)
|
||||
{
|
||||
if (!(flags & TODO_update_address_taken))
|
||||
execute_update_addresses_taken (true);
|
||||
execute_update_addresses_taken ();
|
||||
compute_may_aliases ();
|
||||
}
|
||||
else if (optimize && (flags & TODO_update_address_taken))
|
||||
execute_update_addresses_taken ();
|
||||
|
||||
if (flags & TODO_remove_unused_locals)
|
||||
remove_unused_locals ();
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ extern void delete_tree_ssa (void);
|
|||
extern bool ssa_undefined_value_p (tree);
|
||||
extern void warn_uninit (tree, const char *, void *);
|
||||
extern unsigned int warn_uninitialized_vars (bool);
|
||||
extern void execute_update_addresses_taken (bool);
|
||||
extern void execute_update_addresses_taken (void);
|
||||
|
||||
/* Call-back function for walk_use_def_chains(). At each reaching
|
||||
definition, a function with this prototype is called. */
|
||||
|
|
|
|||
|
|
@ -1885,9 +1885,9 @@ non_rewritable_mem_ref_base (tree ref)
|
|||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* When possible, clear ADDRESSABLE bit or set the REGISTER bit
|
||||
and mark the variable VAR for conversion into SSA. Returns true
|
||||
when updating stmts is required. */
|
||||
/* When possible, clear TREE_ADDRESSABLE bit or set DECL_GIMPLE_REG_P bit and
|
||||
mark the variable VAR for conversion into SSA. Return true when updating
|
||||
stmts is required. */
|
||||
|
||||
static bool
|
||||
maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
|
||||
|
|
@ -1918,11 +1918,12 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
|
|||
update_vops = true;
|
||||
if (dump_file)
|
||||
{
|
||||
fprintf (dump_file, "No longer having address taken ");
|
||||
fprintf (dump_file, "No longer having address taken: ");
|
||||
print_generic_expr (dump_file, var, 0);
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!DECL_GIMPLE_REG_P (var)
|
||||
&& !bitmap_bit_p (not_reg_needs, DECL_UID (var))
|
||||
&& (TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE
|
||||
|
|
@ -1935,7 +1936,7 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
|
|||
update_vops = true;
|
||||
if (dump_file)
|
||||
{
|
||||
fprintf (dump_file, "Decl is now a gimple register ");
|
||||
fprintf (dump_file, "Now a gimple register: ");
|
||||
print_generic_expr (dump_file, var, 0);
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
|
|
@ -1947,14 +1948,14 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
|
|||
/* Compute TREE_ADDRESSABLE and DECL_GIMPLE_REG_P for local variables. */
|
||||
|
||||
void
|
||||
execute_update_addresses_taken (bool do_optimize)
|
||||
execute_update_addresses_taken (void)
|
||||
{
|
||||
tree var;
|
||||
gimple_stmt_iterator gsi;
|
||||
basic_block bb;
|
||||
bitmap addresses_taken = BITMAP_ALLOC (NULL);
|
||||
bitmap not_reg_needs = BITMAP_ALLOC (NULL);
|
||||
bool update_vops = false;
|
||||
tree var;
|
||||
unsigned i;
|
||||
|
||||
/* Collect into ADDRESSES_TAKEN all variables whose address is taken within
|
||||
|
|
@ -2047,20 +2048,16 @@ execute_update_addresses_taken (bool do_optimize)
|
|||
}
|
||||
}
|
||||
|
||||
/* When possible, clear ADDRESSABLE bit or set the REGISTER bit
|
||||
and mark variable for conversion into SSA. */
|
||||
if (optimize && do_optimize)
|
||||
{
|
||||
/* We cannot iterate over all referenced vars as that can contain
|
||||
unused vars from BLOCK trees which cause code generation
|
||||
differences for -g vs. -g0. */
|
||||
for (var = DECL_ARGUMENTS (cfun->decl); var; var = DECL_CHAIN (var))
|
||||
update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
|
||||
FOR_EACH_VEC_ELT (tree, cfun->local_decls, i, var)
|
||||
update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
|
||||
}
|
||||
/* We cannot iterate over all referenced vars because that can contain
|
||||
unused vars from BLOCK trees, which causes code generation differences
|
||||
for -g vs. -g0. */
|
||||
for (var = DECL_ARGUMENTS (cfun->decl); var; var = DECL_CHAIN (var))
|
||||
update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
|
||||
|
||||
/* Operand caches needs to be recomputed for operands referencing the updated
|
||||
FOR_EACH_VEC_ELT (tree, cfun->local_decls, i, var)
|
||||
update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs);
|
||||
|
||||
/* Operand caches need to be recomputed for operands referencing the updated
|
||||
variables. */
|
||||
if (update_vops)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue