[hjl@gnu-31 build_base_o2.0000]$ /usr/gcc-4.3/bin/gcc foo.i -O2 -S foo.c: In function ‘Perl_pp_int’: foo.c:60: internal compiler error: in subreg_get_info, at rtlanal.c:3065 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. [hjl@gnu-31 build_base_o2.0000]$ /usr/gcc-4.3/bin/gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /net/gnu-13/export/gnu/src/gcc/gcc/configure --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld --enable-shared --enable-threads=posix --enable-haifa --enable-checking=assert --prefix=/usr/gcc-4.3 --with-local-prefix=/usr/local Thread model: posix gcc version 4.3.0 20061226 (experimental) [trunk revision 120211]
Created attachment 12844 [details] A testcase A testcase
Reduced testcase, fails with -O or higher: ========================================= inline double bar(double x) { long double d; __asm__ ("" : "=t" (d) : "0" (x)); return d; } double foo(double x) { if (x) return bar(x); else return bar(x); } =========================================
Hmm, I don't know this is really valid code.
A similar error that may be related was posted here: http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01713.html The testcase in my post was from a gcc bootstrap.
Subject: Bug 30311 Author: jsm28 Date: Tue Jan 2 00:38:21 2007 New Revision: 120329 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120329 Log: gcc: PR middle-end/30311 * caller-save.c (add_stored_regs): Only handle SUBREGs if inner REG is a hard register. Do not modify REG before calling subreg_nregs. * rtlanal.c (subreg_get_info): Don't assert size of XMODE is a multiple of the size of YMODE for certain lowpart cases. gcc/testsuite: * gcc.c-torture/compile/pr30311.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr30311.c Modified: trunk/gcc/ChangeLog trunk/gcc/caller-save.c trunk/gcc/rtlanal.c trunk/gcc/testsuite/ChangeLog
sparc-sun-solaris2.10 issue appears to be fixed. http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00470.html
Gcc 4.2 revision 120343 compiles SPEC CPU 2006 correctly.