re PR tree-optimization/40233 (Test failures with "alignment of array elements is...
authorRichard Guenther <rguenther@suse.de>
Sun, 24 May 2009 16:12:58 +0000 (16:12 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 24 May 2009 16:12:58 +0000 (16:12 +0000)
2009-05-24  Richard Guenther  <rguenther@suse.de>

PR middle-end/40233
* tree.c (make_vector_type): Build the TYPE_DEBUG_REPRESENTATION_TYPEs
array type from the main variant of the inner type.

* gcc.c-torture/compile/pr40233.c: New testcase.

From-SVN: r147835

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr40233.c [new file with mode: 0644]
gcc/tree.c

index 0fcaff6c3784a4693baa423e7658dd37484bad58..8730f68fb5ae224c21cd9e98bb5b92d55a053240 100644 (file)
@@ -1,3 +1,9 @@
+2009-05-24  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/40233
+       * tree.c (make_vector_type): Build the TYPE_DEBUG_REPRESENTATION_TYPEs
+       array type from the main variant of the inner type.
+
 2009-05-24  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
 
        * config/vax/vax-protos.h (legitimate_constant_address_p): Change
index c066bc722f6ffdd2a8600bb40c0a9b0b2105bc85..cbfaf2155867bf1005c76d222b4626b0cba63142 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-24  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/40233
+       * gcc.c-torture/compile/pr40233.c: New testcase.
+
 2009-05-24  Uros Bizjak  <ubizjak@gmail.com>
 
        * gfortran.dg/erf_2.F90 (dg-options): Add -mieee
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40233.c b/gcc/testsuite/gcc.c-torture/compile/pr40233.c
new file mode 100644 (file)
index 0000000..b3487ed
--- /dev/null
@@ -0,0 +1,10 @@
+typedef int aligned __attribute__((aligned(64)));
+struct Frame {
+  aligned i;
+};
+
+void foo(struct Frame *p)
+{
+  aligned *q = &p->i;
+  *q = 0;
+}
index f0e861cb5cd8f4e1be54e61e3ef461e0372aa07c..ddfa0a4325820428818cef0cdd98b5e8e19dc373 100644 (file)
@@ -7446,7 +7446,8 @@ make_vector_type (tree innertype, int nunits, enum machine_mode mode)
 
   {
     tree index = build_int_cst (NULL_TREE, nunits - 1);
-    tree array = build_array_type (innertype, build_index_type (index));
+    tree array = build_array_type (TYPE_MAIN_VARIANT (innertype),
+                                  build_index_type (index));
     tree rt = make_node (RECORD_TYPE);
 
     TYPE_FIELDS (rt) = build_decl (FIELD_DECL, get_identifier ("f"), array);