diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2009-01-18 16:26:26 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2009-01-18 08:26:26 -0800 |
commit | 6e4f11689b8ac84b5f3eb618e88b0b3a9cc74008 (patch) | |
tree | d74a458bc64925e0158a42b28d1bdf62ea7614fb /gcc/testsuite/g++.dg/compat/abi | |
parent | 890065bfe4a9d3367568a2f5a9a12b6289f377d0 (diff) | |
download | gcc-6e4f11689b8ac84b5f3eb618e88b0b3a9cc74008.tar.gz |
re PR target/38736 (-mavx can change the ABI via BIGGEST_ALIGNMENT)
gcc/
2009-01-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/38736
* c-common.c (handle_aligned_attribute): Use
ATTRIBUTE_ALIGNED_VALUE instead of BIGGEST_ALIGNMENT for
default alignment value.
* c-cppbuiltin.c (c_cpp_builtins): Define __BIGGEST_ALIGNMENT__.
* defaults.h (ATTRIBUTE_ALIGNED_VALUE): New.
* config/i386/i386.h (ATTRIBUTE_ALIGNED_VALUE): Likewise.
* doc/extend.texi: Update __attribute__ ((aligned)). Document
__BIGGEST_ALIGNMENT__.
* doc/tm.texi: Document ATTRIBUTE_ALIGNED_VALUE.
gcc/testsuite/
2009-01-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/38736
* g++.dg/compat/abi/pr38736_main.C: New.
* g++.dg/compat/abi/pr38736_x.C: Likewise.
* g++.dg/compat/abi/pr38736_y.C: Likewise.
* g++.dg/other/macro-1.C: Likewise.
* gcc.dg/macro-1.c: Likewise.
* gcc.dg/compat/pr38736_main.c: Likewise.
* gcc.dg/compat/pr38736_x.c: Likewise.
* gcc.dg/compat/pr38736_y.c: Likewise.
From-SVN: r143486
Diffstat (limited to 'gcc/testsuite/g++.dg/compat/abi')
-rw-r--r-- | gcc/testsuite/g++.dg/compat/abi/pr38736_main.C | 18 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/compat/abi/pr38736_x.C | 15 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/compat/abi/pr38736_y.C | 6 |
3 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/compat/abi/pr38736_main.C b/gcc/testsuite/g++.dg/compat/abi/pr38736_main.C new file mode 100644 index 00000000000..b9f6ac898ff --- /dev/null +++ b/gcc/testsuite/g++.dg/compat/abi/pr38736_main.C @@ -0,0 +1,18 @@ +/* PR target/38736 */ +/* { dg-skip-if "attribute ((aligned))" { ! { i?86-*-* x86_64-*-* } } } */ +/* { dg-require-effective-target avx } */ + +/* Test compatibility of attribute ((aligned)) with and without -mavx. */ + +extern int aligned_x (void); +extern int aligned_y_avx (void); +extern "C" void abort (void); + +int +main () +{ + if (aligned_x () != aligned_y_avx ()) + abort (); + + return 0; +} diff --git a/gcc/testsuite/g++.dg/compat/abi/pr38736_x.C b/gcc/testsuite/g++.dg/compat/abi/pr38736_x.C new file mode 100644 index 00000000000..aeab257aae9 --- /dev/null +++ b/gcc/testsuite/g++.dg/compat/abi/pr38736_x.C @@ -0,0 +1,15 @@ +/* PR target/38736 */ +/* { dg-options "-O2" } */ + +struct alignment_test_struct +{ + char space[4] __attribute__((__aligned__)); +}; + +extern int aligned_x (void); + +int +aligned_x (void) +{ + return __alignof__(struct alignment_test_struct); +} diff --git a/gcc/testsuite/g++.dg/compat/abi/pr38736_y.C b/gcc/testsuite/g++.dg/compat/abi/pr38736_y.C new file mode 100644 index 00000000000..bade1b2927b --- /dev/null +++ b/gcc/testsuite/g++.dg/compat/abi/pr38736_y.C @@ -0,0 +1,6 @@ +/* PR target/38736 */ +/* { dg-options "-O2 -mavx" } */ + +#define aligned_x aligned_y_avx + +#include "pr38736_x.C" |