]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Don't pass -msse2avx to assembler for -mavx
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 5 Oct 2018 11:40:59 +0000 (11:40 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 5 Oct 2018 11:40:59 +0000 (04:40 -0700)
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: r264867

gcc/ChangeLog
gcc/config/i386/gnu-user.h
gcc/config/i386/gnu-user64.h

index e84f4936fad1a539dac8bd9e6580223bfc32c528..6cf4f5e99012e05e033cc32550fe7ebc5b2b64e9 100644 (file)
@@ -1,3 +1,13 @@
+2018-10-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from mainline
+       2018-10-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       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-10-03  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
index a4c88f1a848001eb300840351aef88a424af48c8..0e49f0512a4e9e073c093e375c1ac2f3a33b5b45 100644 (file)
@@ -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 \
index 39f5ef6a68bbc36c5a87f47afa006036277aabef..911fbd4651c9fbe2841e25f00b212005774a6b2d 100644 (file)
@@ -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 "} \