The documentation claims that gcc can write out double precision floating point arithmetic if the hardware can't do it SIMD. When compiling with -O3, this results in the ICE above, when compiling without -O, it produces bogus results. Compiled with: gcc -Wall -ggdb -march=pentium3 -msse simd.c -o simd -O3 Code: typedef int v4df __attribute__ ((mode(V4DF))); typedef int v4sf __attribute__ ((mode(V4SF))); union dvector4 { v4df vect; double e[4]; }; union fvector4 { v4sf vect; float e[4]; }; int main() { int n; union dvector4 a, b; a.e[0]=0; a.e[1]=10; a.e[2]=20; a.e[3]=30; b.e[0]=0; b.e[1]=0; b.e[2]=0; b.e[3]=0; for(n=0;n<1000;++n) { b.vect = b.vect + a.vect; /* b.e[0] = b.e[0] + a.e[0]; b.e[1] = b.e[1] + a.e[1]; b.e[2] = b.e[2] + a.e[2]; b.e[3] = b.e[3] + a.e[3]; */ } // printf("%f, %f, %f, %f\n", c.e[0], c.e[1], c.e[2], c.e[3]); return 0; }
Confirmed on the mainline.
Confirmed with 3.4 as well: -------------- typedef int v4df __attribute__ ((mode(V4DF))); int main() { v4df a, b; b = b + a; return 0; } ------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -Wall -ggdb -march=pentium3 -msse x.c -O3 x.c: In function `main': x.c:6: internal compiler error: in extract_bit_field, at expmed.c:1152 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. g/x> /home/bangerth/bin/gcc-3.5-pre/bin/gcc -Wall -ggdb -march=pentium3 -msse x.c -O3 x.c:1: warning: specifying vector types with __attribute__ ((mode)) is deprecated x.c:1: warning: use __attribute__ ((vector_size)) instead x.c: In function `main': x.c:6: internal compiler error: in extract_bit_field, at expmed.c:1152 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. W.
The reduced testcase no longer fails as the code is removed before getting to RTL. Here is a better reduced testcase: typedef double v4df __attribute__((vector_size(64))); v4df main() { v4df a, b; b = b + a; return b; }
Fixed on the mainline: : Search converges between 2004-03-01-trunk (#446) and 2004-04-01-trunk (#447).