From 8a9c1ae6bfcdfa9a589c6f8f98b6a9b8f495d9e5 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 30 Jun 2010 18:51:36 +0200 Subject: 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 --- gcc/ipa-split.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/ipa-split.c') diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index ae784b6..289a7b3 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); -- cgit v1.1