This code causes ICE on gcc 4.0.3 on x86_64. typedef long long vec __attribute__ ((vector_size(16))); vec vecsqr(vec a) { return a*a; } Commandline: gcc -O1 -S -o - tmp.c Resulting output: .file "tmp.c" tmp.c: In function 'vecsqr': tmp.c:2: error: unrecognizable insn: (insn 13 12 15 0 (set (reg:DI 58 [ D.1470 ]) (vec_select:DI (reg/v:V2DI 61 [ a ]) (parallel [ (const_int 1 [0x1]) ]))) -1 (nil) (expr_list:REG_DEAD (reg/v:V2DI 61 [ a ]) (nil))) tmp.c:2: internal compiler error: in extract_insn, at recog.c:2020 It goes ICE on when -O option >= 1. -O0 does not trigger it. Option -mno-sse also disables the ICE, but then it gives "error: SSE register return with SSE disabled". -mno-sse2 doesn't disable it. Unsigned/signed type has no effect to result. Without __attribute__((vector_size)), it does not ICE. GCC version (gcc -v): Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release x86_64-linux-gnu Thread model: posix gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
Confirmed, just a 4.0 regression.
Set to P2. This bug is somewhat exotic, and not a regression from previous 4.0.x releases.
Created attachment 11018 [details] bug fix this a backport form the mainline 2005-05-17 Richard Henderson <rth@redhat.com> * config/i386/sse.md (mulv16qi3, mulv2di3): New
Fixed in GCC-4.1.0.