Bug#164588: gcc-3.2: -march=athlon or -march=pentium2 with -O2 incorrectly mix MMX with FPU
Package: gcc-3.2
Version: 1:3.2.1-0pre2
Severity: normal
I tracked down this problem in the DRI CVS source tree. When compiling
with -O2 -march=athlon or -O2 -march=pentium2 the generated code
incorrectly mixes MMX and FPU instructions. I generated a stripped
down preprocessed file and added a small main function and 2 printfs
to demonstrate the problem. I will submit it as attachment with a
follow-up mail. This is the exact compiler command line:
gcc-3.2 -Wall -O2 -march=athlon -o radeon_state2 radeon_state2.i
The programme is compiled correctly with:
gcc-3.2 -Wall -O2 -mcpu=athlon -o radeon_state2 radeon_state2.i
or
gcc-3.2 -Wall -O2 -march=athlon -mno-mmx -mno-3dnow -o radeon_state2 radeon_state2.i
The incorrect version produces this output
Inside if: 133 != nan || 589 != nan
and a sigsegv since I didn't fake things up enough in the main function ;-)
The correct version produces this output:
Outside if: 133 != 133.000000 || 589 != 589.000000
-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux viking 2.4.19 #6 Fre Sep 27 23:46:47 CEST 2002 i686
Locale: LANG=de_DE.ISO-8859-1, LC_CTYPE=de_DE.ISO-8859-1
Versions of packages gcc-3.2 depends on:
ii binutils 2.13.90.0.4-1 The GNU assembler, linker and bina
ii cpp-3.2 1:3.2.1-0pre2 The GNU C preprocessor.
ii gcc-3.2-base 1:3.2.1-0pre2 The GNU Compiler Collection (base
ii libc6 2.2.5-14.3 GNU C Library: Shared libraries an
ii libgcc1 1:3.2.1-0pre2 GCC support library.
Reply to: