Here is foo.c: [bidou@pit tmp]$ cat foo.c #define vector64 __attribute__((vector_size(8))) vector64 short a; vector64 short b; vector64 short c; void foo () { c = -a + b*b*(-1LL); /* c is now {5, 3} */ printf("result is %llx\n", (long long)c); } ****************************************************************************** Here is foo.c preprocessed: [bidou@pit tmp]$ gcc-3.3 -mmmx -E foo.c # 1 "foo.c" # 1 "<built-in>" # 1 "<command line>" # 1 "foo.c" __attribute__((vector_size(8))) short a; __attribute__((vector_size(8))) short b; __attribute__((vector_size(8))) short c; void foo () { c = -a + b*b*(-1LL); printf("result is %llx\n", (long long)c); } ****************************************************************************** And here is the command line that failed and its result: [bidou@pit tmp]$ gcc-3.3 -mmmx -v foo.c Reading specs from /home/bidou/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs Configured with: ../gcc-3.3/configure --prefix=/home/bidou --enable-languages=c --program-suffix=-3.3 Thread model: posix gcc version 3.3 /home/bidou/lib/gcc-lib/i686-pc-linux-gnu/3.3/cc1 -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 foo.c -quiet -dumpbase foo.c -mmmx -auxbase foo -version -o /tmp/ccGuYsey.s GNU C version 3.3 (i686-pc-linux-gnu) compiled by GNU C version 3.3. GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64213 ignoring nonexistent directory "/home/bidou/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /home/bidou/include /home/bidou/lib/gcc-lib/i686-pc-linux-gnu/3.3/include /usr/include End of search list. foo.c: In function `foo': foo.c:14: internal compiler error: in output_constant_pool, at varasm.c:3492 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. ******************************************************************************* Host and target machine is an Athlon-XP PC running RedHat 8.0. I tried the same with varying options for building GCC and for the compilation of foo.c, and got exactly the same result. The testsuite does not detect this (simd-5.c) because either no MMX code is tried (no MMX enabling flag) or the -O3 is optimizing out calculation in contact propagation with my standard CFLAGS.
Hello, I can confirm that this behavior is present on gcc 3.3 branch and mainline (20030520). The code does not compile on gcc 3.2, so it is not a regression. Dara
Confirmed according to Dara, not a regression since 3.2 did not support the vector_size attribute.
This is the same problem as bug 7277 but with a simpler testcase. *** This bug has been marked as a duplicate of 7277 ***