Commit 5bf734fa by Richard Biener Committed by Richard Biener

re PR tree-optimization/87211 (gcc ICE at O2: in set_ssa_val_to, at tree-ssa-sccvn.c:3628)

2018-09-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87211
	* tree-ssa-sccvn.c (visit_phi): When value-numbering to a
	backedge value we're supposed to treat as VARYING also number
	the PHI to VARYING in case it got a different value-number already.

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

From-SVN: r264079
parent e20d979b
2018-09-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/87211
* tree-ssa-sccvn.c (visit_phi): When value-numbering to a
backedge value we're supposed to treat as VARYING also number
the PHI to VARYING in case it got a different value-number already.
2018-09-04 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (vrp_can_optimize_bit_op): Remove.
......
2018-09-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/87211
* gcc.dg/torture/pr87211.c: New testcase.
2018-09-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/87176
* gcc.dg/torture/pr87176.c: New testcase.
* gcc.dg/torture/ssa-fre-1.c: Likewise.
......
/* { dg-do compile } */
int a, b;
int i(int *);
int *c(int *d, int *e)
{
for (; b;)
d = e;
return d;
}
void f()
{
for (;;)
{
int *g[1];
int h = 0;
for (; h < 3; h++)
g[0] = &a;
&a == g[0] || i(c((int *)g, g[0]));
}
}
......@@ -4180,7 +4180,8 @@ visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p)
}
/* If the value we want to use is the backedge and that wasn't visited
yet drop to VARYING. This only happens when not iterating.
yet or if we should take it as VARYING but it has a non-VARYING
value drop to VARYING. This only happens when not iterating.
If we value-number a virtual operand never value-number to the
value from the backedge as that confuses the alias-walking code.
See gcc.dg/torture/pr87176.c. If the value is the same on a
......@@ -4190,7 +4191,8 @@ visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p)
&& TREE_CODE (backedge_val) == SSA_NAME
&& sameval == backedge_val
&& (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)
|| !SSA_VISITED (backedge_val)))
|| !SSA_VISITED (backedge_val)
|| SSA_VAL (backedge_val) != backedge_val))
/* Note this just drops to VARYING without inserting the PHI into
the hashes. */
result = PHI_RESULT (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