This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/69471] "-march=native" unintentionally breaks further -march/-mtune flags
- From: "thiago at kde dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Nov 2018 18:36:24 +0000
- Subject: [Bug target/69471] "-march=native" unintentionally breaks further -march/-mtune flags
- Auto-submitted: auto-generated
- References: <bug-69471-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69471
--- Comment #6 from Thiago Macieira <thiago at kde dot org> ---
Clang is not affected:
$ clang -dM -E -xc /dev/null -march=sandybridge -march=native | grep AVX
#define __AVX2__ 1
#define __AVX__ 1
$ clang -dM -E -xc /dev/null -march=native -march=sandybridge | grep AVX
#define __AVX__ 1
Instead of enabling the CPU features your CPU has, Clang tries to guess which
CPU you have and will apply it. This has side-effects for non-arch-specific
items like AES.
ICC is similarly affected, despite claiming it isn't:
$ icc -dM -E -xc /dev/null -march=sandybridge -march=native | grep AVX
icc: command line warning #10121: overriding '-march=sandybridge' with
'-march=native'
icc: command line warning #10121: overriding '-march=sandybridge' with
'-march=native'
#define __AVX_I__ 1
#define __AVX__ 1
#define __AVX2__ 1
$ icc -dM -E -xc /dev/null -march=native -march=sandybridge | grep AVX
icc: command line warning #10121: overriding '-march=native' with
'-march=sandybridge'
#define __AVX_I__ 1
#define __AVX__ 1
#define __AVX2__ 1
It says it's overriding, but doesn't override.