From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 Description of problem: Compiling the attached program with "-O -march=pentium4 -mfpmath=sse" causes the compiler to get confused. Leaving off -mfpmath=sse or -O, or specifying -march=i686 work (although the latter issues a warning that 387 will be used instead). Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. gcc -v -c -O -march=pentium4 -mfpmath=sse mipmap2.c (attached) 2. 3. Actual Results: [~] gcc -v -c -O -march=pentium4 -mfpmath=sse mipmap2.c Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.2 20020822 (Red Hat Linux Rawhide 3.2-3) /usr/lib/gcc-lib/i386-redhat-linux/3.2/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE__ -D__MMX__ -D__SSE2__ mipmap2.c -quiet -dumpbase mipmap2.c -march=pentium4 -mfpmath=sse -O -version -o /tmp/cc1bXltj.s GNU CPP version 3.2 20020822 (Red Hat Linux Rawhide 3.2-3) (cpplib) (i386 Linux/ELF) GNU C version 3.2 20020822 (Red Hat Linux Rawhide 3.2-3) (i386-redhat-linux) compiled by GNU C version 3.2 20020822 (Red Hat Linux Rawhide 3.2-3). ignoring nonexistent directory "/usr/i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc-lib/i386-redhat-linux/3.2/include /usr/include End of search list. mipmap2.c: In function `halve1Dimage_float': mipmap2.c:41: unable to find a register to spill in class `FLOAT_REGS' mipmap2.c:41: this is the insn: (insn 100 98 102 (set (subreg:SF (reg/v:DI 22 rxmm1 [73]) 0) (float:SF (reg:DI 0 rax [85]))) 170 {*floatdisf2_i387_only} (insn_list 97 (nil)) (expr_list:REG_DEAD (reg:DI 0 rax [85]) (nil))) mipmap2.c:41: confused by earlier errors, bailing out [~] Additional info:
Created attachment 73448 [details] Source code for register spill problem
gcc version 3.2.1 20021125 (Red Hat Linux 8.0 3.2.1-1) Still crashes with same symptoms. Interestingly enough, -O, -O2, and -O3 all cause the error, but -Os does *NOT*. Examining the assembly output from '-S' shows references to %xmmN for n in 0..3 so apparently it is using the -mfpmath=sse even with -Os. So the problem is in some optimization inhibited with -Os.
Re-tested with rawhide gcc-3.3-5, problem is fixed. Possibly fixed earlier, have not re-checked lately.