re PR middle-end/28862 (attribute ((aligned)) ignored on vector variables)
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 7 Sep 2006 15:36:50 +0000 (15:36 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 7 Sep 2006 15:36:50 +0000 (08:36 -0700)
2006-09-07  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/28862
        * stor-layout.c (relayout_decl): Don't zero the alignment if it
        was set by the user.

2006-09-07  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/28862
        * gcc.c-torture/compile/vector-align-1.c: New test.

From-SVN: r116751

gcc/ChangeLog
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/vector-align-1.c [new file with mode: 0644]

index f3d086b..b3e4028 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-07  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/28862
+       * stor-layout.c (relayout_decl): Don't zero the alignment if it
+       was set by the user.
+
 2006-09-07  Paolo Bonzini  <bonzini@gnu.org>
 
        PR target/27117
index 415f7c1..d1e18a2 100644 (file)
@@ -489,7 +489,8 @@ relayout_decl (tree decl)
 {
   DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0;
   DECL_MODE (decl) = VOIDmode;
-  DECL_ALIGN (decl) = 0;
+  if (!DECL_USER_ALIGN (decl))
+    DECL_ALIGN (decl) = 0;
   SET_DECL_RTL (decl, 0);
 
   layout_decl (decl, 0);
index 0e052be..d8a5631 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-07  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/28862
+       * gcc.c-torture/compile/vector-align-1.c: New test.
+
 2006-09-06  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR rtl-opt/27883
diff --git a/gcc/testsuite/gcc.c-torture/compile/vector-align-1.c b/gcc/testsuite/gcc.c-torture/compile/vector-align-1.c
new file mode 100644 (file)
index 0000000..dc97ba6
--- /dev/null
@@ -0,0 +1,11 @@
+/* Check to make sure the alignment on vectors is not being lost. */
+
+/* If some target has a Max alignment less than 128, please create
+   a #ifdef around the alignment and add your alignment.  */
+#define alignment 128
+
+char x __attribute__((aligned(alignment),vector_size(2)));
+
+
+int f[__alignof__(x) == alignment?1:-1];
+