summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-30 08:01:28 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-30 08:01:28 +0000
commitb2d81d54d2bea61bcd9856e0a646beec526b7f27 (patch)
tree7a07dff5c74eee4bffb4874c3fbefe85e870f507
parent774649800f0ded10ed2674a68c2f299ee00f0534 (diff)
downloadppe42-gcc-b2d81d54d2bea61bcd9856e0a646beec526b7f27.tar.gz
ppe42-gcc-b2d81d54d2bea61bcd9856e0a646beec526b7f27.zip
PR tree-optimization/29637
* tree.c (make_vector_type): Don't recurse if TYPE_MAIN_VARIANT of the innertype is the innertype itself. * gcc.dg/pr29637.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118175 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr29637.c23
-rw-r--r--gcc/tree.c3
4 files changed, 36 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index def4fca1deb..abcdecefe87 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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-30 Danny Smith <dannysmith@users.sourceforge.net>
* dwarf2out.c (file_name_acquire): Correct typo.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1d44a4c6f7b..3d1049466d6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/29637
+ * gcc.dg/pr29637.c: New test.
+
2006-10-29 Roger Sayle <roger@eyesopen.com>
* gcc.dg/fold-compare-1.c: Update to reflect recent changes in
diff --git a/gcc/testsuite/gcc.dg/pr29637.c b/gcc/testsuite/gcc.dg/pr29637.c
new file mode 100644
index 00000000000..5dfee41b1d5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr29637.c
@@ -0,0 +1,23 @@
+/* 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;
+}
diff --git a/gcc/tree.c b/gcc/tree.c
index 8f869fa16ba..d0c56c40dd2 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6400,7 +6400,8 @@ make_vector_type (tree innertype, int nunits, enum machine_mode mode)
/* 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),
OpenPOWER on IntegriCloud