re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in...
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 May 2016 11:38:38 +0000 (13:38 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 3 May 2016 11:38:38 +0000 (13:38 +0200)
PR tree-optimization/70916
* tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Give up
if COND_EXPR rhs1 is neither SSA_NAME nor COMPARISON_CLASS_P.

* gcc.c-torture/compile/pr70916.c: New test.

From-SVN: r235814

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr70916.c [new file with mode: 0644]
gcc/tree-vect-patterns.c

index 7122b6c2ba98bd28fd90f2d700a095302f461a98..83760681c0de0691ebabb167ae04cf8b98622514 100644 (file)
@@ -1,5 +1,9 @@
 2016-05-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/70916
+       * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Give up
+       if COND_EXPR rhs1 is neither SSA_NAME nor COMPARISON_CLASS_P.
+
        PR target/49244
        * tree-ssa-ccp.c: Include stor-layout.h and optabs-query.h.
        (optimize_atomic_bit_test_and): New function.
index b29f76334fe6356c7d33599a5de02052f7933103..0941f39afa5d7a226d7d63451801c8f583a3370a 100644 (file)
@@ -1,5 +1,8 @@
 2016-05-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/70916
+       * gcc.c-torture/compile/pr70916.c: New test.
+
        PR target/49244
        * gcc.target/i386/pr49244-1.c: New test.
        * gcc.target/i386/pr49244-2.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70916.c b/gcc/testsuite/gcc.c-torture/compile/pr70916.c
new file mode 100644 (file)
index 0000000..c3ea69f
--- /dev/null
@@ -0,0 +1,28 @@
+/* PR tree-optimization/70916 */
+
+int a, b, c, d, i, k;
+int static *e = &b, *j;
+int **f;
+int static ***g = &f;
+int *h;
+void
+fn1 ()
+{
+  for (;;)
+    {
+      int l[1] = { };
+      int m = (__UINTPTR_TYPE__) l;
+      for (; d; d--)
+       {
+         int ****n;
+         int *****o = &n;
+         i = a & 7 ? : a;
+         *e = (((*o = &g) != (int ****) g) < h[c], 0) || k;
+         if (*e)
+           {
+             **n = &j;
+             *e = (__UINTPTR_TYPE__) h;
+           }
+       }
+    }
+}
index 27080d28a1d639fb83172d6eba4ec8eb8e683ee5..d08b45477568dec2bf291ee8c271b42d29585533 100644 (file)
@@ -3673,8 +3673,10 @@ vect_recog_mask_conversion_pattern (vec<gimple *> *stmts, tree *type_in,
          if (!rhs1_type)
            return NULL;
        }
-      else
+      else if (COMPARISON_CLASS_P (rhs1))
        rhs1_type = TREE_TYPE (TREE_OPERAND (rhs1, 0));
+      else
+       return NULL;
 
       vectype2 = get_mask_type_for_scalar_type (rhs1_type);