[Bug target/93254] New: g++ -m32 -mfpmath=sse -msse generates sse2 instructions

abrahm.scully at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Jan 13 16:31:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93254

            Bug ID: 93254
           Summary: g++ -m32 -mfpmath=sse -msse generates sse2
                    instructions
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abrahm.scully at gmail dot com
  Target Milestone: ---

Created attachment 47648
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47648&action=edit
preprocessed source file

Running "gcc -v" prints

"Reading specs from /opt/tools-20190901/lib/gcc/i686-pc-linux-gnu/9/specs
COLLECT_GCC=/opt/tools-20190901/bin/gcc
COLLECT_LTO_WRAPPER=/opt/tools-20190901/libexec/gcc/i686-pc-linux-gnu/9/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/opt/tools-20190901 --with-system-zlib
--enable-languages=c,c++,fortran,lto --enable-bootstrap --enable-libgomp
--enable-checking=release --enable-shared --enable-threads=posix
--with-host-libstdcxx=''\''-Wl,-rpath,/opt/tools-20190901/lib,-lstdc++'\'''
--enable-initfini-array --enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --with-zstd --enable-__cxa_atexit
--disable-libunwind-exceptions --with-gcc-major-version-only --with-isl
--disable-multilib
Thread model: posix
gcc version 9.2.1 20191214 (GCC)"

The host and target OS is x86-32 CentOS 6.10, and the target hardware has a
Pentium III (Coppermine) processor.

Compile the attached preprocessed file with "g++ -S -m32 -mfpmath=sse -msse
-mno-sse2 -o gcc-sse-broken.s gcc_sse_movd_test.ii".

The output contains "movd r32, xmm" instructions like "movd %ecx, %xmm1" that
according to https://www.felixcloutier.com/x86/movd:movq are SSE2 instructions.
I don't think they should be emitted with the given compiler, platform, and
command line options.

(Using compiler explorer (see https://godbolt.org/z/nCeEnz), I did some probing
of other gcc versions. The problem is present with gcc 9.1 to trunk. Using gcc
8.3 and earlier don't emit the "movd r32, xmm" instructions in the
"std::complex<float>::__rep() const" routine, unless I remove the -mno-sse2
which I expect.)


More information about the Gcc-bugs mailing list