Commit 897da303 by Richard Biener Committed by Richard Biener

re PR tree-optimization/82217 (ICE on valid code at -O1 and above: in visit_phi,…

re PR tree-optimization/82217 (ICE on valid code at -O1 and above: in visit_phi, at tree-ssa-sccvn.c:3908)

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

	PR tree-optimization/82217
	* tree-ssa-sccvn.c (visit_phi): Properly handle all VN_TOP
	but not undefined case.

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

From-SVN: r252796
parent 854dde43
2017-09-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/82217
* tree-ssa-sccvn.c (visit_phi): Properly handle all VN_TOP
but not undefined case.
2017-09-15 Jakub Jelinek <jakub@redhat.com> 2017-09-15 Jakub Jelinek <jakub@redhat.com>
PR target/82145 PR target/82145
......
2017-09-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/82217
* gcc.dg/torture/pr82217.c: New testcase.
2017-09-15 Jakub Jelinek <jakub@redhat.com> 2017-09-15 Jakub Jelinek <jakub@redhat.com>
PR target/82145 PR target/82145
......
/* { dg-do compile } */
int a, b, c;
void fn1 ()
{
while (1)
{
if (c)
goto L2;
break;
}
if (c)
{
L1:
{
int g[1];
if (b)
goto L1;
goto L1;
L2:
for (a = 0; a;)
goto L1;
}
}
}
int main ()
{
fn1 ();
return 0;
}
...@@ -3901,13 +3901,10 @@ visit_phi (gimple *phi) ...@@ -3901,13 +3901,10 @@ visit_phi (gimple *phi)
if only a single edge is exectuable use its value. */ if only a single edge is exectuable use its value. */
if (n_executable <= 1) if (n_executable <= 1)
result = seen_undef ? seen_undef : sameval; result = seen_undef ? seen_undef : sameval;
/* If we saw only undefined values create a new undef SSA name to /* If we saw only undefined values and VN_TOP use one of the
avoid false equivalences. */ undefined values. */
else if (sameval == VN_TOP) else if (sameval == VN_TOP)
{ result = seen_undef ? seen_undef : sameval;
gcc_assert (seen_undef);
result = seen_undef;
}
/* First see if it is equivalent to a phi node in this block. We prefer /* First see if it is equivalent to a phi node in this block. We prefer
this as it allows IV elimination - see PRs 66502 and 67167. */ this as it allows IV elimination - see PRs 66502 and 67167. */
else if ((result = vn_phi_lookup (phi))) else if ((result = vn_phi_lookup (phi)))
......
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