Following invalid C function gives internal compiler error on x86_64, but not on x86, on GCC 3.4.3 and 3.3.5: char blabla(unsigned int a) { return &((unsigned char *) &a)[0]; } 3.3.5 gives: $ ./gcc -Wall -O2 -c /test/char.c /test/char.c: In function `blabla': /test/char.c:3: warning: return makes integer from pointer without a cast /test/char.c:4: error: unrecognizable insn: (insn 29 11 13 0 (nil) (set (reg:SI 0 eax [62]) (subreg:SI (plus:DI (subreg:DI (reg:QI 7 spl) 0) (const_int -4 [0xfffffffffffffffc])) 0)) -1 (nil) (nil)) /test/char.c:4: internal compiler error: in extract_insn, at recog.c:2175 $ ./gcc -v Reading specs from /build/gcc/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.5/specs Configured with: ./configure --enable-languages=c --prefix=/build/gcc Thread model: posix gcc version 3.3.5 3.4.3 gives: $ ./gcc -Wall -O2 -c /test/char.c /test/char.c: In function `blabla': /test/char.c:3: warning: return makes integer from pointer without a cast /test/char.c:4: error: unrecognizable insn: (insn 30 11 13 0 (set (reg:SI 0 ax [62]) (subreg:SI (plus:DI (subreg:DI (reg:QI 7 sp) 0) (const_int -4 [0xfffffffffffffffc])) 0)) -1 (nil) (nil)) /test/char.c:4: internal compiler error: in extract_insn, at recog.c:2083 $ ./gcc -v Reading specs from /build/gcc/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/specs Configured with: ./configure --enable-languages=c --prefix=/build/gcc Thread model: posix gcc version 3.4.3
The code is undefined but still valid, well really it is invalid if you don't have a cast. This is all fixed on the mainline for 4.0.0 anyways and since this is not a regression closing as fixed.