Commit 4f912f91 by Richard Biener Committed by Richard Biener

re PR tree-optimization/67470 (ICE at -O3 on x86_64-linux-gnu in…

re PR tree-optimization/67470 (ICE at -O3 on x86_64-linux-gnu in compute_live_loop_exits, at tree-ssa-loop-manip.c:235)

2015-09-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/67470
	* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
	structure for PHI hoisting by inserting a forwarder block
	if appropriate.

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

From-SVN: r227797
parent 20adfc6c
2015-09-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/67470
* tree-ssa-loop-im.c (execute_sm_if_changed): Preserve PHI
structure for PHI hoisting by inserting a forwarder block
if appropriate.
2015-09-15 Christian Bruel <christian.bruel@st.com> 2015-09-15 Christian Bruel <christian.bruel@st.com>
* config/arm/arm.c (TARGET_OPTION_PRINT): Define. * config/arm/arm.c (TARGET_OPTION_PRINT): Define.
......
2015-09-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/67470
* gcc.dg/torture/pr67470.c: New testcase.
2015-09-15 Alan Lawrence <alan.lawrence@arm.com> 2015-09-15 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/aarch64/vect_int32x2x4_1.c: New. * gcc.target/aarch64/vect_int32x2x4_1.c: New.
......
/* { dg-do run } */
int a, b, *c, d, e;
void abort (void);
int
main ()
{
int f, *g, **h = &g;
for (; b;)
{
c = &a;
for (e = 0; e < 1; e++)
*h = 0;
for (; d; d++)
if (f)
*c = 0;
else
{
*c = e = 0;
*h = &a;
}
if (a && !g)
abort ();
}
return 0;
}
...@@ -1839,6 +1839,23 @@ execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag) ...@@ -1839,6 +1839,23 @@ execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag)
if (loop_has_only_one_exit) if (loop_has_only_one_exit)
ex = split_block_after_labels (ex->dest); ex = split_block_after_labels (ex->dest);
else
{
for (gphi_iterator gpi = gsi_start_phis (ex->dest);
!gsi_end_p (gpi); gsi_next (&gpi))
{
gphi *phi = gpi.phi ();
if (virtual_operand_p (gimple_phi_result (phi)))
continue;
/* When the destination has a non-virtual PHI node with multiple
predecessors make sure we preserve the PHI structure by
forcing a forwarder block so that hoisting of that PHI will
still work. */
split_edge (ex);
break;
}
}
old_dest = ex->dest; old_dest = ex->dest;
new_bb = split_edge (ex); new_bb = split_edge (ex);
......
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