===================================================================
@@ -1,3 +1,9 @@
+2010-06-30 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/PR44706
+ * ipa-split (split_function): Refine conditions when to use DECL_RESULT
+ to return the value.
+
2010-06-30 Michael Matz <matz@suse.de>
PR bootstrap/44699
===================================================================
@@ -931,6 +931,13 @@ split_function (struct split_point *spli
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);
===================================================================
@@ -1,3 +1,7 @@
+2010-06-30 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/ipa-split-4.c: New testcase.
+
2010-06-30 Michael Matz <matz@suse.de>
PR bootstrap/44699
===================================================================
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-fnsplit" } */
+int make_me_big (void);
+
+int
+split_me (int a)
+{
+ if (__builtin_expect(a<10, 1))
+ {
+ abort ();
+ }
+ else
+ {
+ make_me_big ();
+ make_me_big ();
+ make_me_big ();
+ make_me_big ();
+ return a+1;
+ }
+}
+
+main()
+{
+ return split_me (0)+split_me(1)+split_me(2);
+}
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */