From: H.J. Lu Date: Fri, 12 Oct 2018 12:34:36 +0000 (+0000) Subject: i386: Don't pass -msse2avx to assembler for -mavx X-Git-Tag: releases/gcc-6.5.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0b0bc007cb21d0541dee0f80544884d5d74d06e;p=thirdparty%2Fgcc.git i386: Don't pass -msse2avx to assembler for -mavx With gcc -O2 -fPIC -flto -g -c -o a.o a.c gcc -O2 -fPIC -flto -g -mavx -c -o b.o b.c gcc -shared -O2 -fPIC -flto -g -o lib1.so a.o b.o LTO correctly generates AVX for b.o and SSE for a.o. But the GCC driver passes -msse2avx to assembler, which encodes SSE instructions as AVX instructions. We shouldn't pass -msse2avx to assembler for -mavx. Backport from mainline PR target/87522 * config/i386/gnu-user.h (ASM_SPEC): Don't pass -msse2avx to assembler for -mavx. * config/i386/gnu-user64.h (ASM_SPEC): Likewise. From-SVN: r265090 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dfe7efc61fb2..acfb3175e4d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2018-10-12 H.J. Lu + + Backport from mainline + 2018-10-05 H.J. Lu + + PR target/87522 + * config/i386/gnu-user.h (ASM_SPEC): Don't pass -msse2avx to + assembler for -mavx. + * config/i386/gnu-user64.h (ASM_SPEC): Likewise. + 2018-09-19 John David Anglin * config/pa/pa.md (atomic_storeqi): Restore deleted expander. diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h index fee33a3efdcb..3842f8928d53 100644 --- a/gcc/config/i386/gnu-user.h +++ b/gcc/config/i386/gnu-user.h @@ -67,7 +67,7 @@ along with GCC; see the file COPYING3. If not see #undef ASM_SPEC #define ASM_SPEC \ - "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" + "--32 %{msse2avx:%{!mavx:-msse2avx}}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h index 7a02a7eb4d79..5aa2876739fb 100644 --- a/gcc/config/i386/gnu-user64.h +++ b/gcc/config/i386/gnu-user64.h @@ -50,7 +50,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define ASM_SPEC "%{" SPEC_32 ":--32} \ %{" SPEC_64 ":--64} \ %{" SPEC_X32 ":--x32} \ - %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" + %{msse2avx:%{!mavx:-msse2avx}}" #define GNU_USER_TARGET_LINK_SPEC \ "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \