]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/64563 (ICE with "-Wall -Wextra" at -Os and above...
authorJakub Jelinek <jakub@redhat.com>
Sun, 1 Feb 2015 21:50:53 +0000 (22:50 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 1 Feb 2015 21:50:53 +0000 (22:50 +0100)
Backported from mainline
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.

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

From-SVN: r220332

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

index 2f71306db30c172e09011beac57aa41f0f429447..c5bca53607b5958421161afa6c866c51269ec02b 100644 (file)
@@ -3,6 +3,10 @@
        Backported from mainline
        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 b855a38d8e6de450de245b2af936e77eba70e1d3..909c125d9623ac16299d03f1af98e56b9a5ec2ab 100644 (file)
@@ -3,6 +3,9 @@
        Backported from mainline
        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 96a439a9b8a1b18650e841c4616b0b50e7e37b3f..6363e45382229ec758265f3bf6a6b72b9f007a1e 100644 (file)
@@ -6811,7 +6811,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)