]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/59903 (ICE on valid code at -O3 on x86_64-linux-gnu (affectin...
authorRichard Biener <rguenther@suse.de>
Thu, 30 Jan 2014 15:30:30 +0000 (15:30 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 30 Jan 2014 15:30:30 +0000 (15:30 +0000)
2014-01-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/59903
* tree-vect-loop.c (vect_transform_loop): Guard multiple-types
check properly.

* gcc.dg/torture/pr59903.c: New testcase.

From-SVN: r207307

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr59903.c [new file with mode: 0644]
gcc/tree-vect-loop.c

index d571a8faf440ec64a72d81a81c370bb4b03484a1..ca5a89311eff4512222aae330a1c217f80d918f2 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-30  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/59903
+       * tree-vect-loop.c (vect_transform_loop): Guard multiple-types
+       check properly.
+
 2014-01-30  Jason Merrill  <jason@redhat.com>
 
        PR c++/59633
index 22a79d4d971250aaf13546617ac17e13ab539757..5b3e071d9c9d2857d4ca6703064d56c4595fb292 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-30  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/59903
+       * gcc.dg/torture/pr59903.c: New testcase.
+
 2014-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/58843
diff --git a/gcc/testsuite/gcc.dg/torture/pr59903.c b/gcc/testsuite/gcc.dg/torture/pr59903.c
new file mode 100644 (file)
index 0000000..01772df
--- /dev/null
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+
+int a, b, c, d, e, f, g, h, i[3], l, m, n, o, p, q, r;
+
+struct S0
+{
+  int f0;
+  int f1;
+  int f2;
+  int f3;
+} j;
+
+static int
+fn1 (int p1)
+{
+  return p1 || ((p1 > 0) > (e << 1)); 
+}
+
+static struct S0
+fn2 (struct S0 p1)
+{
+  char s;
+  struct S0 t = {0,0,0,0};
+  int u = 2;
+  for (;;)
+    {
+      if (i[0])
+       break;
+      for (m = 0; m < 4; m++)
+       for (p1.f0 = 0; p1.f0 < 3; p1.f0++)
+         {
+           j = t;
+           t.f3 = i[p1.f0];
+           o = b || 1 >> b ? 0 : a < 0;
+           q = 1 % d;
+           if ((g < fn1 ((1 ^ (q & 1)) | n)) ^ u)
+             j.f3 |= p % 2;
+           s = j.f3 > 0 ? j.f3 : j.f3 << 1;
+           r = l = s && p1.f1 * c;
+           h = p1.f1;
+         }
+    }
+  return p1;
+}
+
+int
+main ()
+{
+  for (;f;)
+    {
+      struct S0 v = {0,0,0,0};
+      fn2 (v);
+      j.f3 = 0;
+    }
+  return 0;
+}
index 69c8d21960677d09672e2e608e388458f4de1956..2bb9fbdb2f1c38bf45b63fc49c48210349b638f9 100644 (file)
@@ -5869,8 +5869,9 @@ vect_transform_loop (loop_vec_info loop_vinfo)
              && !STMT_VINFO_LIVE_P (stmt_info))
            continue;
 
-         if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info))
-               != (unsigned HOST_WIDE_INT) vectorization_factor)
+         if (STMT_VINFO_VECTYPE (stmt_info)
+             && (TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info))
+                 != (unsigned HOST_WIDE_INT) vectorization_factor)
              && dump_enabled_p ())
            dump_printf_loc (MSG_NOTE, vect_location, "multiple-types.\n");