Commit 8a9c1ae6 by Jan Hubicka Committed by Jan Hubicka

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
parent 8a1561bc
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> 2010-06-30 Michael Matz <matz@suse.de>
PR bootstrap/44699 PR bootstrap/44699
......
...@@ -931,6 +931,13 @@ split_function (struct split_point *split_point) ...@@ -931,6 +931,13 @@ split_function (struct split_point *split_point)
if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl)))) if (!VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
{ {
retval = DECL_RESULT (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)) if (is_gimple_reg (retval))
retval = make_ssa_name (retval, call); retval = make_ssa_name (retval, call);
gimple_call_set_lhs (call, retval); gimple_call_set_lhs (call, retval);
......
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> 2010-06-30 Michael Matz <matz@suse.de>
PR bootstrap/44699 PR bootstrap/44699
......
/* { 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment