Don't leak ISA to __attribute__ ((target("arch=XXX")))
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 19 Oct 2015 11:18:14 +0000 (11:18 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 19 Oct 2015 11:18:14 +0000 (04:18 -0700)
commit3f11bf19d9b1877e75d795a70edfc0aee560bb6b
treeca29e6587bfedc678e7a19fb2aeae37a9ea045f8
parent7be37b351aa82ce8225d8d95c07782ffc0e0f759
Don't leak ISA to __attribute__ ((target("arch=XXX")))

When processing __attribute__ ((target("arch=XXX"))), we should clear
the ISA bits in x_ix86_isa_flags first to avoid leaking ISA from
command line.

gcc/

PR target/67995
* config/i386/i386.c (ix86_valid_target_attribute_tree): If
arch= is set,  clear all bits in x_ix86_isa_flags, except for
ISA_64BIT, ABI_64, ABI_X32, and CODE16.

gcc/testsuite/

PR target/67995
* gcc.target/i386/pr67995-1.c: New test.
* gcc.target/i386/pr67995-2.c: Likewise.
* gcc.target/i386/pr67995-3.c: Likewise.

From-SVN: r228967
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr67995-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67995-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67995-3.c [new file with mode: 0644]