diff options
author | Jan Hubicka <jh@suse.cz> | 2010-06-30 18:51:36 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-06-30 16:51:36 +0000 |
commit | 8a9c1ae6bfcdfa9a589c6f8f98b6a9b8f495d9e5 (patch) | |
tree | f361e2a80e7a7827dd9e5ce2c1670aec9d8c2d38 /gcc/ipa-split.c | |
parent | 8a1561bcd07c8e630f1e7492c364a664dd6f3d69 (diff) | |
download | gcc-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.c | 7 |
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); |