aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-split.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-10-13 12:07:44 +0000
committerRichard Guenther <rguenther@suse.de>2011-10-13 12:07:44 +0000
commite401a8df6523f69137d302b47bce2ab250c25db7 (patch)
tree9fd933d033a83db660e820c57dd9f7e20bfb6a5f /gcc/ipa-split.c
parentd0c7e4571759959992376964a6f793c942818e4b (diff)
2011-10-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/50712 * ipa-split.c (split_function): Always re-gimplify parameters when they are not gimple vals before passing them. Properly check for type compatibility. * gcc.target/i386/pr50712.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@179919 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-split.c')
-rw-r--r--gcc/ipa-split.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index d1861e9ed54..75cc619c042 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -958,7 +958,6 @@ split_function (struct split_point *split_point)
tree retval = NULL, real_retval = NULL;
bool split_part_return_p = false;
gimple last_stmt = NULL;
- bool conv_needed = false;
unsigned int i;
tree arg;
@@ -1000,12 +999,8 @@ split_function (struct split_point *split_point)
else
arg = parm;
- if (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm))
- != TYPE_MAIN_VARIANT (TREE_TYPE (arg)))
- {
- conv_needed = true;
- arg = fold_convert (DECL_ARG_TYPE (parm), arg);
- }
+ if (!useless_type_conversion_p (DECL_ARG_TYPE (parm), TREE_TYPE (arg)))
+ arg = fold_convert (DECL_ARG_TYPE (parm), arg);
VEC_safe_push (tree, heap, args_to_pass, arg);
}
@@ -1135,14 +1130,13 @@ split_function (struct split_point *split_point)
/* Produce the call statement. */
gsi = gsi_last_bb (call_bb);
- if (conv_needed)
- FOR_EACH_VEC_ELT (tree, args_to_pass, i, arg)
- if (!is_gimple_val (arg))
- {
- arg = force_gimple_operand_gsi (&gsi, arg, true, NULL_TREE,
- false, GSI_NEW_STMT);
- VEC_replace (tree, args_to_pass, i, arg);
- }
+ FOR_EACH_VEC_ELT (tree, args_to_pass, i, arg)
+ if (!is_gimple_val (arg))
+ {
+ arg = force_gimple_operand_gsi (&gsi, arg, true, NULL_TREE,
+ false, GSI_NEW_STMT);
+ VEC_replace (tree, args_to_pass, i, arg);
+ }
call = gimple_build_call_vec (node->decl, args_to_pass);
gimple_set_block (call, DECL_INITIAL (current_function_decl));