From: Richard Biener Date: Tue, 1 Aug 2017 07:04:10 +0000 (+0000) Subject: re PR tree-optimization/81297 (ICE in get_single_symbol) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e8fe12fccb2edeb1b699101167b1c921a742bb7;p=gcc.git re PR tree-optimization/81297 (ICE in get_single_symbol) 2017-08-01 Richard Biener PR tree-optimization/81297 * tree-vrp.c (get_single_symbol): Remove assert, instead drop TREE_OVERFLOW from INTEGER_CSTs. * gcc.dg/torture/pr81297.c: New testcase. From-SVN: r250758 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3913f1b37fc..2e964271d00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-08-01 Richard Biener + + PR tree-optimization/81297 + * tree-vrp.c (get_single_symbol): Remove assert, instead drop + TREE_OVERFLOW from INTEGER_CSTs. + 2017-07-31 Segher Boessenkool * config/rs6000/rs6000.c (enum rs6000_reg_type): Delete trailing comma. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9315835f4d6..8ae9ef50c39 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-08-01 Richard Biener + + PR tree-optimization/81297 + * gcc.dg/torture/pr81297.c: New testcase. + 2017-07-31 Uros Bizjak * gcc.target/i386/naked-1.c (dg-options): Add -fno-pic. diff --git a/gcc/testsuite/gcc.dg/torture/pr81297.c b/gcc/testsuite/gcc.dg/torture/pr81297.c new file mode 100644 index 00000000000..be346c4c0d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr81297.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +int +nf (int gy, int x0) +{ + while (gy < 1) + ++x0; + + gy += !!gy; + if (gy < 0) + { + x0 += gy; + return (x0 > (gy + x0)) ? (1 / 0) : 1; /* { dg-warning "division by zero" } */ + } +} + diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 1f0b6880c45..79a29bf0efb 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -796,7 +796,8 @@ get_single_symbol (tree t, bool *neg, tree *inv) if (TREE_CODE (t) != SSA_NAME) return NULL_TREE; - gcc_assert (! inv_ || ! TREE_OVERFLOW_P (inv_)); + if (inv_ && TREE_OVERFLOW_P (inv_)) + inv_ = drop_tree_overflow (inv_); *neg = neg_; *inv = inv_;