diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-16 13:36:07 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-16 13:36:07 +0000 |
commit | cbbd431db44c0fcdec1ee5b512c6713ae52c879e (patch) | |
tree | 752809a1f846941f2448e11b38d3c7b1eb14bac5 /gcc/tree-inline.c | |
parent | 35505f9a3a15cf010218500bfffb0e682c97ff4d (diff) | |
download | linaro-gcc-cbbd431db44c0fcdec1ee5b512c6713ae52c879e.tar.gz linaro-gcc-cbbd431db44c0fcdec1ee5b512c6713ae52c879e.tar.bz2 linaro-gcc-cbbd431db44c0fcdec1ee5b512c6713ae52c879e.zip |
2012-05-16 Richard Guenther <rguenther@suse.de>
* tree-inline.c (insert_init_stmt): Do not call
mark_symbols_for_renaming.
(setup_one_parameter): Avoid initializing unused parameters.
(declare_return_variable): Properly handle DECL_BY_REFERENCE
return vars in SSA form.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187593 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index c9aaeeeda3a..045f194d972 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2542,7 +2542,6 @@ insert_init_stmt (copy_body_data *id, basic_block bb, gimple init_stmt) } gsi_insert_after (&si, init_stmt, GSI_NEW_STMT); gimple_regimplify_operands (init_stmt, &si); - mark_symbols_for_renaming (init_stmt); if (!is_gimple_debug (init_stmt) && MAY_HAVE_DEBUG_STMTS) { @@ -2707,14 +2706,17 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn, STRIP_USELESS_TYPE_CONVERSION (rhs); - /* We want to use MODIFY_EXPR, not INIT_EXPR here so that we - keep our trees in gimple form. */ - if (def && gimple_in_ssa_p (cfun) && is_gimple_reg (p)) + /* If we are in SSA form properly remap the default definition + or omit the initialization if the parameter is unused. */ + if (gimple_in_ssa_p (cfun) && is_gimple_reg (p)) { - def = remap_ssa_name (def, id); - init_stmt = gimple_build_assign (def, rhs); - SSA_NAME_IS_DEFAULT_DEF (def) = 0; - set_default_def (var, NULL); + if (def) + { + def = remap_ssa_name (def, id); + init_stmt = gimple_build_assign (def, rhs); + SSA_NAME_IS_DEFAULT_DEF (def) = 0; + set_default_def (var, NULL); + } } else init_stmt = gimple_build_assign (var, rhs); @@ -2974,10 +2976,15 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, if (gimple_in_ssa_p (id->src_cfun)) add_referenced_var (temp); insert_decl_map (id, result, temp); - /* When RESULT_DECL is in SSA form, we need to use it's default_def - SSA_NAME. */ - if (gimple_in_ssa_p (id->src_cfun) && gimple_default_def (id->src_cfun, result)) - temp = remap_ssa_name (gimple_default_def (id->src_cfun, result), id); + /* When RESULT_DECL is in SSA form, we need to remap and initialize + it's default_def SSA_NAME. */ + if (gimple_in_ssa_p (id->src_cfun) + && is_gimple_reg (result)) + { + temp = make_ssa_name (temp, NULL); + insert_decl_map (id, gimple_default_def (id->src_cfun, result), + temp); + } insert_init_stmt (id, entry_bb, gimple_build_assign (temp, var)); } else |