Commit cffcafda by Richard Biener Committed by Richard Biener

re PR tree-optimization/79186 (ICE on valid code at -O2 and -O3 on…

re PR tree-optimization/79186 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu:  Segmentation fault (in VRP))

2017-01-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79186
	* tree-vrp.c (register_new_assert_for): Make sure we've seen
	both incoming edges before moving an assert.

	* gcc.dg/torture/pr79186.c: New testcase.
	* gcc.dg/torture/pr79187.c: Likewise.

From-SVN: r244804
parent bda2bc48
2017-01-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/79186
* tree-vrp.c (register_new_assert_for): Make sure we've seen
both incoming edges before moving an assert.
2017-01-23 Martin Jambor <mjambor@suse.cz> 2017-01-23 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (load_from_param_1): Removed. * ipa-prop.c (load_from_param_1): Removed.
......
2017-01-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/79186
* gcc.dg/torture/pr79186.c: New testcase.
* gcc.dg/torture/pr79187.c: Likewise.
2017-01-23 Martin Jambor <mjambor@suse.cz> 2017-01-23 Martin Jambor <mjambor@suse.cz>
* gcc.dg/ipa/vrp8.c: New test. * gcc.dg/ipa/vrp8.c: New test.
......
/* { dg-do run } */
int a, b;
unsigned char c, d, e;
int main ()
{
if (b || !a)
{
c = a;
if (!c && !a)
d = 0;
e = -a;
}
return 0;
}
/* { dg-do run } */
int printf (const char *, ...);
int a, b = -600, c, d[] = { 0 }, e, f, g = -1, h;
unsigned i = ~0;
int main ()
{
for (; h < 2; h++)
{
if (a > 0)
printf ("%d\n", d[b]);
f = ~(b % i);
c = g | (f && g) && e | b;
a = ~(~g & b);
}
return 0;
}
...@@ -5035,6 +5035,7 @@ register_new_assert_for (tree name, tree expr, ...@@ -5035,6 +5035,7 @@ register_new_assert_for (tree name, tree expr,
/* If we have the same assertion on all incoming edges of a BB /* If we have the same assertion on all incoming edges of a BB
instead insert it at the beginning of it. */ instead insert it at the beginning of it. */
if (e && loc->e if (e && loc->e
&& e != loc->e
&& dest_bb == loc->e->dest && dest_bb == loc->e->dest
&& EDGE_COUNT (dest_bb->preds) == 2) && EDGE_COUNT (dest_bb->preds) == 2)
{ {
......
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