re PR tree-optimization/68455 (ICE: tree check: expected integer_cst, have plus_expr...
authorMarek Polacek <polacek@redhat.com>
Mon, 23 Nov 2015 17:18:36 +0000 (17:18 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 23 Nov 2015 17:18:36 +0000 (17:18 +0000)
PR tree-optimization/68455
* tree-vrp.c (extract_range_from_binary_expr_1): Don't call
extract_range_from_multiplicative_op_1 on symbolic ranges.

* gcc.dg/tree-ssa/pr68455.c: New test.

From-SVN: r230768

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr68455.c [new file with mode: 0644]
gcc/tree-vrp.c

index cd57e0c27a7d89a4bbf18145b2ec4ca31e73b838..0bcfc9ebf05e1b1f33f5611acfb50c264af05e20 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-23  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/68455
+       * tree-vrp.c (extract_range_from_binary_expr_1): Don't call
+       extract_range_from_multiplicative_op_1 on symbolic ranges.
+
 2015-11-23  Richard Henderson  <rth@redhat.com>
 
        * optabs.def (uaddv4_optab, usubv4_optab): New.
index dd7f96a8faaccb1abfaba0c8261bd0868ddf00af..d65527fbdadd409e41d29f506930fc5dea386563 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-23  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/68455
+       * gcc.dg/tree-ssa/pr68455.c: New test.
+
 2015-11-23  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/68465
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68455.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68455.c
new file mode 100644 (file)
index 0000000..6b46b30
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR tree-optimization/68455 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int r;
+int n;
+
+void
+fn1 (void)
+{
+  int i;
+
+  for (i = 0; i < 1; ++i)
+    {
+      unsigned short int u;
+      if (u < n)
+       r = 1 / n;
+    }
+}
index 70011908acbf9adcaeb563661e66d00c88352c40..acbb70bbbfda43bb81ccf3a818b5469cafd671ea 100644 (file)
@@ -3015,7 +3015,7 @@ extract_range_from_binary_expr_1 (value_range *vr,
              return;
            }
        }
-      else
+      else if (!symbolic_range_p (&vr0) && !symbolic_range_p (&vr1))
        {
          extract_range_from_multiplicative_op_1 (vr, code, &vr0, &vr1);
          return;