diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-09-23 22:06:18 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-09-23 22:06:18 +0000 |
commit | f61c8291cb98f2284dbadaa3a36866133815c438 (patch) | |
tree | c7aca0553f8807b3027757e66ed3dad50f7880a2 /gcc/tree-ssa.c | |
parent | 962b8a0e7e609d75dcb3e9b28bc381a4976695a9 (diff) | |
download | gcc-f61c8291cb98f2284dbadaa3a36866133815c438.zip gcc-f61c8291cb98f2284dbadaa3a36866133815c438.tar.gz gcc-f61c8291cb98f2284dbadaa3a36866133815c438.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 10c7ab9..0b83b37 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -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); + + FOR_EACH_VEC_ELT (tree, cfun->local_decls, i, var) + update_vops |= maybe_optimize_var (var, addresses_taken, not_reg_needs); - /* Operand caches needs to be recomputed for operands referencing the updated + /* Operand caches need to be recomputed for operands referencing the updated variables. */ if (update_vops) { |