re PR tree-optimization/34330 (-ftree-parallelize-loops=4 ICE with the vectorizer...
authorRichard Guenther <rguenther@suse.de>
Thu, 15 May 2008 08:21:32 +0000 (08:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 15 May 2008 08:21:32 +0000 (08:21 +0000)
2008-05-15  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/34330
* tree-ssa-alias.c (get_smt_for): Only assert that accesses
through the pointer will alias the SMT.

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

From-SVN: r135329

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr34330.c [new file with mode: 0644]
gcc/tree-ssa-alias.c

index c39de0f2dd69bcccc05db3d89376fede4fe7b833..7451ace922f49bb1d17a27c7104f318f37be470a 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/34330
+       * tree-ssa-alias.c (get_smt_for): Only assert that accesses
+       through the pointer will alias the SMT.
+
 2008-05-14  Andreas Tobler  <a.tobler@schweiz.org>
 
        * config/sparc/sparc.h (NO_PROFILE_COUNTERS): Define as 0.
index 02ef0b5f8cb43836a57572dc4d6ca745b124eb4a..8215e221cd27a2fa4cba81a6fb5a9d8351abefc0 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/34330
+       * gcc.dg/torture/pr34330.c: New testcase.
+
 2008-05-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR fortran/36059
diff --git a/gcc/testsuite/gcc.dg/torture/pr34330.c b/gcc/testsuite/gcc.dg/torture/pr34330.c
new file mode 100644 (file)
index 0000000..85cfe37
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-parallelize-loops=4 -ftree-vectorize" } */
+
+struct T
+{
+  int t;
+  struct { short s1, s2, s3, s4; } *s;
+};
+
+void
+foo (int *a, int *b, int *c, int *d, struct T *e)
+{
+  int i;
+  for (i = 0; i < e->t; i++)
+    {
+      e->s[i].s1 = a[i];
+      e->s[i].s2 = b[i];
+      e->s[i].s3 = c[i];
+      e->s[i].s4 = d[i];
+    }
+}
index ddd793752895c3b3483eedf0373d72a59cfa03ef..a054329e8d4c6502d9e51db1831da2294fd1dea3 100644 (file)
@@ -3025,8 +3025,11 @@ get_smt_for (tree ptr, struct alias_info *ai)
   TREE_THIS_VOLATILE (tag) |= TREE_THIS_VOLATILE (tag_type);
 
   /* Make sure that the symbol tag has the same alias set as the
-     pointed-to type.  */
-  gcc_assert (tag_set == get_alias_set (tag));
+     pointed-to type or at least accesses through the pointer will
+     alias that set.  The latter can happen after the vectorizer
+     created pointers of vector type.  */
+  gcc_assert (tag_set == get_alias_set (tag)
+             || alias_set_subset_of (tag_set, get_alias_set (tag)));
 
   return tag;
 }