re PR tree-optimization/64563 (ICE with "-Wall -Wextra" at -Os and above on x86_64...
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Jan 2015 20:48:09 +0000 (21:48 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Jan 2015 20:48:09 +0000 (21:48 +0100)
PR tree-optimization/64563
* tree-vrp.c (vrp_evaluate_conditional): Check for VR_RANGE
instead of != VR_VARYING.

* gcc.dg/pr64563.c: New test.

From-SVN: r219493

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

index 4a21711b41ab393d662b5ec8e642c48b2e23c1ee..e3ff175ce8c4f3e25e0907849ee562a8c5fbf80e 100644 (file)
@@ -1,5 +1,9 @@
 2015-01-12  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/64563
+       * tree-vrp.c (vrp_evaluate_conditional): Check for VR_RANGE
+       instead of != VR_VARYING.
+
        PR target/64513
        * config/i386/i386.c (ix86_expand_prologue): Add
        REG_FRAME_RELATED_EXPR to %rax and %r10 pushes.
index 1b441e492da1c46b2aad1f3dd84d3b080144a99e..03e7acf7957d862d1fa8b1f80cd2d3949adaff16 100644 (file)
@@ -1,5 +1,8 @@
 2015-01-12  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/64563
+       * gcc.dg/pr64563.c: New test.
+
        PR target/64513
        * gcc.target/i386/pr64513.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr64563.c b/gcc/testsuite/gcc.dg/pr64563.c
new file mode 100644 (file)
index 0000000..7223349
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR tree-optimization/64563 */
+/* { dg-do compile } */
+/* { dg-options "-Os -Wtype-limits" } */
+
+int a, b, c, d, f;
+unsigned int e;
+
+void
+foo (void)
+{
+  d = b = (a != (e | 4294967288UL));
+  if (!d)
+    c = f || b;
+}
index ecf86c35666d26ad23878de6e2f999befde56f4c..f3e1d3d635165a781ef0cad1d818e68acb145018 100644 (file)
@@ -7545,7 +7545,7 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, gimple stmt)
       tree type = TREE_TYPE (op0);
       value_range_t *vr0 = get_value_range (op0);
 
-      if (vr0->type != VR_VARYING
+      if (vr0->type == VR_RANGE
          && INTEGRAL_TYPE_P (type)
          && vrp_val_is_min (vr0->min)
          && vrp_val_is_max (vr0->max)