From: Richard Biener Date: Mon, 30 Jan 2017 14:24:37 +0000 (+0000) Subject: re PR tree-optimization/79276 (ICE: Segmentation fault in VRP pass) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c7247cc1e822a29b8b4d009b30bb17f2c0c841b;p=gcc.git re PR tree-optimization/79276 (ICE: Segmentation fault in VRP pass) 2017-01-30 Richard Biener PR tree-optimization/79276 * tree-vrp.c (process_assert_insertions): Properly adjust common when removing a duplicate. * gcc.dg/torture/pr79276.c: New testcase. From-SVN: r245026 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96a210e9c1e..9339949a86f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-01-30 Richard Biener + + PR tree-optimization/79276 + * tree-vrp.c (process_assert_insertions): Properly adjust common + when removing a duplicate. + + * gcc.dg/torture/pr79276.c: New testcase. + 2017-01-30 Richard Biener PR tree-optimization/79256 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f93fc0c29f7..33f02489e4e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-30 Richard Biener + + PR tree-optimization/79276 + * gcc.dg/torture/pr79276.c: New testcase. + 2017-01-30 Dominik Vogt PR target/79240 diff --git a/gcc/testsuite/gcc.dg/torture/pr79276.c b/gcc/testsuite/gcc.dg/torture/pr79276.c new file mode 100644 index 00000000000..4abc2a0acdd --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr79276.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +short int +ix (int *ld, short int oi) +{ + *ld = ((unsigned short int)oi | oi) && !!(*ld); + return (oi != 0) ? oi : 1; +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 5c43e35d89c..b429217a267 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -6544,6 +6544,11 @@ process_assert_insertions (void) else if (loc->e == asserts[j-1]->e) { /* Remove duplicate asserts. */ + if (commonj == j - 1) + { + commonj = j; + common = loc; + } free (asserts[j-1]); asserts[j-1] = NULL; }