summaryrefslogtreecommitdiff
path: root/gcc/ipa-split.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-06-30 18:51:36 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-06-30 16:51:36 +0000
commit8a9c1ae6bfcdfa9a589c6f8f98b6a9b8f495d9e5 (patch)
treef361e2a80e7a7827dd9e5ce2c1670aec9d8c2d38 /gcc/ipa-split.c
parent8a1561bcd07c8e630f1e7492c364a664dd6f3d69 (diff)
downloadgcc-8a9c1ae6bfcdfa9a589c6f8f98b6a9b8f495d9e5.tar.gz
PR middle-end/PR44706
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. From-SVN: r161615
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);