]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/28862 (attribute ((aligned)) ignored on vector variables)
authorAndrew Pinski <pinskia@physics.uc.edu>
Mon, 9 Oct 2006 00:30:11 +0000 (00:30 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 9 Oct 2006 00:30:11 +0000 (17:30 -0700)
2006-10-08  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-10-08  Andrew Pinski  <pinskia@physics.uc.edu>

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

From-SVN: r117567

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 8bfc39560bbe62d0fa711a3150386ecce41692ab..723c360256c9a533962252cb14ded087daaf576d 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-08  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-21  Steven Bosscher  <steven@gcc.gnu.org>
 
        PR middle-end/26983
index 78295c5f6f949804760342cc9864d44cf0da9c3b..0e6e4714ab9814005b88602ddab52bc58715f0aa 100644 (file)
@@ -480,7 +480,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 d13c18e03f45b59b887e5f0d789bb9eef06ffa78..9cc68351d8e3c81861b290621cc255318ba90d34 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/28862
+       * gcc.c-torture/compile/vector-align-1.c: New test.
+
 2006-10-08  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.dg/builtins-config.h: Ensure we use -std=c99 on solaris2.
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];
+