summaryrefslogtreecommitdiff
path: root/gcc/ipa-split.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-30 16:51:36 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-30 16:51:36 +0000
commit9eb0b8ee6b2f07aa4579a4f34319a712a97bfcf7 (patch)
treef361e2a80e7a7827dd9e5ce2c1670aec9d8c2d38 /gcc/ipa-split.c
parent78a0527a697b05508d333f35080c1a0b36f3fe35 (diff)
downloadgcc-9eb0b8ee6b2f07aa4579a4f34319a712a97bfcf7.tar.gz
PR middle-end/PR44706
* ipa-split (split_function): Refine conditions when to use DECL_RESULT to return the value. * gcc.dg/tree-ssa/ipa-split-4.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161615 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-split.c')
-rw-r--r--gcc/ipa-split.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index ae784b6dd77..289a7b38beb 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -931,6 +931,13 @@ split_function (struct split_point *split_point)
if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
{
retval = DECL_RESULT (current_function_decl);
+
+ /* We use temporary register to hold value when aggregate_value_p
+ is false. Similarly for DECL_BY_REFERENCE we must avoid extra
+ copy. */
+ if (!aggregate_value_p (retval, TREE_TYPE (current_function_decl))
+ && !DECL_BY_REFERENCE (retval))
+ retval = create_tmp_reg (TREE_TYPE (retval), NULL);
if (is_gimple_reg (retval))
retval = make_ssa_name (retval, call);
gimple_call_set_lhs (call, retval);