Description of problem: "g++ -S foo.cpp" -> ma2.cpp: In function âvoid madd(float4*)â: ma2.cpp:8: internal compiler error: in emit_move_insn, at expr.c:3092 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/ccchT4xI.out file, please attach this to y\ our bugreport. Version-Release number of selected component (if applicable): ]$ gcc -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux Thread model: posix gcc version 4.0.2 20051125 (Red Hat 4.0.2-8) How reproducible: 100% Steps to Reproduce: 1. gcc -S 2. 3. Actual results: as above Expected results: Might be operand constraint errors, etc., but would expect to either complain or produce asm. Additional info: Preprocessed source: // /usr/libexec/gcc/i386-redhat-linux/4.0.2/cc1plus -quiet -D_GNU_SOURCE ma2.cpp -quiet -dumpbase ma2.cpp -auxbase ma2 -o - -frandom-seed=0 # 1 "ma2.cpp" # 1 "<built-in>" # 1 "<command line>" # 1 "ma2.cpp" typedef struct float4 { float f[4]; } float4; void madd (float4 *xp) { float4 x; asm ("movaps %1, %0" : "=x" (x) : "m" (*xp)); asm ("mulps %0, %1" : "=x" (x) : "x" (x)); asm ("addps %0, %1" : "=x" (x) : "x" (x)); asm ("movaps %0, %1" : "=m" (*xp) : "x" (x)); }
This is really invalid in multiple ways. It is true that GCC shouldn't ICE even on as crappy input as this, but it is very low priority. If you want to get it fixed, you can file it upstream in http://gcc.gnu.org/bugzilla/ instead. The testcase bugs are: 1) you can't use x constraint if -msse is not enabled, as there are no registers in the x class in that case 2) you can't use a structure there, it must be some scalar or vector type (say __m128)