+2006-10-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/29637
+ * tree.c (make_vector_type): Don't recurse if TYPE_MAIN_VARIANT
+ of the innertype is the innertype itself.
+
2006-10-26 Paolo Bonzini <bonzini@gnu.org>
PR c/29092
-
* c-typeck.c (digest_init): Always allow initializing vectors
that have static storage duration with compound literals.
* tree.c (build_type_attribute_qual_variant): New, based on
+2006-10-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/29637
+ * gcc.dg/pr29637.c: New test.
+
2006-10-25 Steve Ellcey <sje@cup.hp.com>
* gcc.dg/pthread-init-2.c: Define _POSIX_C_SOURCE on ia64 HP-UX.
--- /dev/null
+/* PR tree-optimization/29637 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+typedef struct __attribute__ ((aligned (8)))
+{
+ short a, b, c, d;
+} A;
+
+typedef struct
+{
+ A a[24];
+} B;
+
+static const A b = { 0, 0, 1, -1 };
+
+void
+foo (B *x)
+{
+ int i;
+ for (i = 0; i <= 20; i += 4)
+ x->a[i] = b;
+}
/* Build a main variant, based on the main variant of the inner type, then
use it to build the variant we return. */
- if (TYPE_ATTRIBUTES (innertype) || TYPE_QUALS (innertype))
+ if ((TYPE_ATTRIBUTES (innertype) || TYPE_QUALS (innertype))
+ && TYPE_MAIN_VARIANT (innertype) != innertype)
return build_type_attribute_qual_variant (
make_vector_type (TYPE_MAIN_VARIANT (innertype), nunits, mode),
TYPE_ATTRIBUTES (innertype),