aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-05-22 09:33:42 +0000
committerRichard Guenther <rguenther@suse.de>2012-05-22 09:33:42 +0000
commit8a105104ddfb63bab9c33e64d0b8e2bbabcd2ace (patch)
tree845678aa8f7c5b020aab51aae511af0805a58969 /gcc/tree-inline.c
parentfa1369ba16b09ab62be672ba04bca87975932093 (diff)
2012-05-22 Richard Guenther <rguenther@suse.de>
PR middle-end/53437 * tree-inline.c (setup_one_parameter): Create a dummy init statement for unused parameters when not optimizing. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187767 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 060b6e5442f..8c116f641be 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2701,7 +2701,8 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
STRIP_USELESS_TYPE_CONVERSION (rhs);
/* If we are in SSA form properly remap the default definition
- or omit the initialization if the parameter is unused. */
+ or assign to a dummy SSA name if the parameter is unused and
+ we are not optimizing. */
if (gimple_in_ssa_p (cfun) && is_gimple_reg (p))
{
if (def)
@@ -2711,6 +2712,11 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
SSA_NAME_IS_DEFAULT_DEF (def) = 0;
set_default_def (var, NULL);
}
+ else if (!optimize)
+ {
+ def = make_ssa_name (var, NULL);
+ init_stmt = gimple_build_assign (def, rhs);
+ }
}
else
init_stmt = gimple_build_assign (var, rhs);