Add -malign-data={abi|compat|cachineline}
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 17 Dec 2014 14:22:57 +0000 (14:22 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 17 Dec 2014 14:22:57 +0000 (06:22 -0800)
commit239711f6afe3070a11c4f1d9266588e8db1217ee
tree5ed4b6970db156cc051eed382941098982ed6791
parent52c691fbfb8c78220816b0f72d8d7af71d2b5261
Add -malign-data={abi|compat|cachineline}

Add -malign-data={abi|compat,cachineline} to control how GCC aligns
variables.  "compat" uses increased alignment value compatible with
GCC 4.8 and earlier, "abi" uses alignment value as specified by the
psABI, and "cacheline" uses increased alignment value to match the
cache line size.  "compat" is the default.

gcc/

PR target/61296
* config/i386/i386-opts.h (ix86_align_data): New enum.
* config/i386/i386.c (ix86_data_alignment): Return the ABI
alignment value for -malign-data=abi, the cachine line size
for -malign-data=cachineline and the older GCC compatible
alignment value for for -malign-data=compat.
* config/i386/i386.opt (malign-data=): New.
* doc/invoke.texi: Document -malign-data=.

gcc/testsuite/

PR target/61296
* gcc.target/i386/pr61296-2.c: New.
* gcc.target/i386/pr61296-2.c: Likewise.
* gcc.target/i386/pr61296-3.c: Likewise.
* gcc.target/i386/pr61296-4.c: Likewise.
* gcc.target/i386/pr61296-5.c: Likewise.
* gcc.target/i386/pr61296-6.c: Likewise.
* gcc.target/i386/pr61296-7.c: Likewise.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>
From-SVN: r218818
13 files changed:
gcc/ChangeLog
gcc/config/i386/i386-opts.h
gcc/config/i386/i386.c
gcc/config/i386/i386.opt
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr61296-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr61296-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr61296-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr61296-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr61296-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr61296-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr61296-7.c [new file with mode: 0644]