Commit d4f4e71c by Richard Biener Committed by Richard Biener

re PR ipa/68721 (wrong code at -Os and above on x86_64-linux-gnu)

2015-12-10  Richard Biener  <rguenther@suse.de>

	PR ipa/68721
	* ipa-split.c (split_function): Record return value properly
	when the split part doesn't set it.

	* gcc.dg/torture/pr68721.c: New testcase.

From-SVN: r231494
parent 77ad3175
2015-12-10 Richard Biener <rguenther@suse.de> 2015-12-10 Richard Biener <rguenther@suse.de>
PR ipa/68721
* ipa-split.c (split_function): Record return value properly
when the split part doesn't set it.
2015-12-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/68806 PR tree-optimization/68806
* tree-vect-loop.c (vect_analyze_loop_2): Properly detect * tree-vect-loop.c (vect_analyze_loop_2): Properly detect
reduction chains and ignore SLP reductions. reduction chains and ignore SLP reductions.
...@@ -1281,7 +1281,7 @@ split_function (basic_block return_bb, struct split_point *split_point, ...@@ -1281,7 +1281,7 @@ split_function (basic_block return_bb, struct split_point *split_point,
to return void instead of just outputting function with undefined return to return void instead of just outputting function with undefined return
value. For structures this affects quality of codegen. */ value. For structures this affects quality of codegen. */
else if (!split_point->split_part_set_retval else if (!split_point->split_part_set_retval
&& find_retval (return_bb)) && (retval = find_retval (return_bb)))
{ {
bool redirected = true; bool redirected = true;
basic_block new_return_bb = create_basic_block (NULL, 0, return_bb); basic_block new_return_bb = create_basic_block (NULL, 0, return_bb);
...@@ -1305,6 +1305,7 @@ split_function (basic_block return_bb, struct split_point *split_point, ...@@ -1305,6 +1305,7 @@ split_function (basic_block return_bb, struct split_point *split_point,
e->count = new_return_bb->count; e->count = new_return_bb->count;
add_bb_to_loop (new_return_bb, current_loops->tree_root); add_bb_to_loop (new_return_bb, current_loops->tree_root);
bitmap_set_bit (split_point->split_bbs, new_return_bb->index); bitmap_set_bit (split_point->split_bbs, new_return_bb->index);
retbnd = find_retbnd (return_bb);
} }
/* When we pass around the value, use existing return block. */ /* When we pass around the value, use existing return block. */
else else
......
2015-12-10 Richard Biener <rguenther@suse.de> 2015-12-10 Richard Biener <rguenther@suse.de>
PR ipa/68721
* gcc.dg/torture/pr68721.c: New testcase.
2015-12-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/68806 PR tree-optimization/68806
* gcc.dg/torture/pr68806.c: New testcase. * gcc.dg/torture/pr68806.c: New testcase.
......
/* { dg-do run } */
extern void abort (void);
int a, b, c, *d, **e = &d;
int *
fn1 ()
{
for (;;)
{
for (; a;)
if (b)
abort ();
break;
}
for (; c;)
;
return &a;
}
int
main ()
{
*e = fn1 ();
if (!d)
abort ();
return 0;
}
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