From: Andrew Pinski Date: Mon, 9 Oct 2006 00:30:11 +0000 (+0000) Subject: re PR middle-end/28862 (attribute ((aligned)) ignored on vector variables) X-Git-Tag: releases/gcc-4.0.4~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eee2348751c5a36fd67e184c044c3ee0d7ee26de;p=thirdparty%2Fgcc.git re PR middle-end/28862 (attribute ((aligned)) ignored on vector variables) 2006-10-08 Andrew Pinski 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 PR middle-end/28862 * gcc.c-torture/compile/vector-align-1.c: New test From-SVN: r117567 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8bfc39560bbe..723c360256c9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-10-08 Andrew Pinski + + 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 PR middle-end/26983 diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 78295c5f6f94..0e6e4714ab98 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d13c18e03f45..9cc68351d8e3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-10-08 Andrew Pinski + + PR middle-end/28862 + * gcc.c-torture/compile/vector-align-1.c: New test. + 2006-10-08 Kaveh R. Ghazi * 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 index 000000000000..dc97ba6ca241 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/vector-align-1.c @@ -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]; +