OSDN Git Service

2008-05-15 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 May 2008 08:21:32 +0000 (08:21 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 May 2008 08:21:32 +0000 (08:21 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135329 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c39de0f..7451ace 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 02ef0b5..8215e22 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 ddd7937..a054329 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;
 }