With today's 3.4.x CVS, when configured with --enable- checking=misc,tree,rtl,rtlflag,gc --enable-languages=c,objc,c++,f77,java -- enable-multilib=no I get an RTL checking failure on x86_64-unknown-linux-gnu in gcc.dg/titype-1.c: gcc.dg/titype-1.c:21: internal compiler error: RTL check: expected elt 0 type 'E' or 'V', have 'i' (rtx reg) in ix86_va_arg, at config/i386/i386.c:3331 To reproduce, run this command: cc1 -fpreprocessed titype-1.i -quiet -dumpbase titype-1.c -mtune=k8 -ansi - auxbase titype-1 -pedantic-errors -ansi -version -o titype-1.s ----------cut here----------------- # 1 "/tmp/kg/34/egcc-3.4-CVS20050130/gcc/testsuite/gcc.dg/titype-1.c" # 1 "<built-in>" # 1 "<command line>" # 1 "/tmp/kg/34/egcc-3.4-CVS20050130/gcc/testsuite/gcc.dg/titype-1.c" typedef int TItype __attribute__ ((mode (TI))); # 1 "/tmp/kg/34/build/gcc/include/stdarg.h" 1 3 4 # 43 "/tmp/kg/34/build/gcc/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 105 "/tmp/kg/34/build/gcc/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; # 11 "/tmp/kg/34/egcc-3.4-CVS20050130/gcc/testsuite/gcc.dg/titype-1.c" 2 extern void abort(void); void foo(int i, ...) { TItype q; va_list va; __builtin_va_start(va,i); q = __builtin_va_arg(va,TItype); __builtin_va_end(va); if (q != 5) abort(); } int main(void) { TItype q = 5; foo(1, q); return 0; }
I think this still can happen on the mainline even though the code has been moved to the tree level, we still access container the same.
still fails with checking here: http://gcc.gnu.org/ml/gcc-testresults/2005-12/msg01585.html
Apparently fails without checking too: http://gcc.gnu.org/ml/gcc-testresults/2005-12/msg01501.html
Confirmed, checking merely gives us a more informative answer. The compile dies on the same line without checking too. Without checking I get: Program received signal SIGSEGV, Segmentation fault. 0x000000000073aeef in ix86_va_arg (valist=0x2aaaaac4b900, type=0x2aaaaac47820) at ../../egcc-3.4-SVN20051230/gcc/config/i386/i386.c:3331 3331 for (i = 0; i < XVECLEN (container, 0); i++) (gdb) p *container $7 = {code = REG, mode = TImode, jump = 0, call = 0, unchanging = 0, volatil = 0, in_struct = 0, used = 0, integrated = 0, frame_related = 0, u = {fld = {{rtint = 0, rtuint = 0, rtstr = 0x0, rtx = 0x0, rtvec = 0x0, rttype = VOIDmode, rt_addr_diff_vec_flags = {min_align = 0, base_after_vec = 0, min_after_vec = 0, max_after_vec = 0, min_after_base = 0, max_after_base = 0, offset_unsigned = 0, scale = 0}, rt_cselib = 0x0, rtbit = 0x0, rttree = 0x0, bb = 0x0, rtmem = 0x0, rtreg = 0x0}}, hwint = {0}}} With checking, I get: titype-1.c: In function `foo': titype-1.c:21: internal compiler error: RTL check: expected elt 0 type 'E' or 'V', have 'i' (rtx reg) in ix86_va_arg, at config/i386/i386.c:3331 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. [...] #4 0x00000000008f18dc in ix86_va_arg (valist=0x1, type=0x2aaaad1fd820) at ../../egcc-3.4-SVN20051230/gcc/config/i386/i386.c:3331 3331 for (i = 0; i < XVECLEN (container, 0); i++) (gdb) p *container $1 = {code = REG, mode = TImode, jump = 0, call = 0, unchanging = 0, volatil = 0, in_struct = 0, used = 0, integrated = 0, frame_related = 0, u = {fld = {{rtint = 0, rtuint = 0, rtstr = 0xafafafaf00000000 <Address 0xafafafaf00000000 out of bounds>, rtx = 0xafafafaf00000000, rtvec = 0xafafafaf00000000, rttype = VOIDmode, rt_addr_diff_vec_flags = {min_align = 0, base_after_vec = 0, min_after_vec = 0, max_after_vec = 0, min_after_base = 0, max_after_base = 0, offset_unsigned = 0, scale = 0}, rt_cselib = 0xafafafaf00000000, rtbit = 0xafafafaf00000000, rttree = 0xafafafaf00000000, bb = 0xafafafaf00000000, rtmem = 0xafafafaf00000000, rtreg = 0xafafafaf00000000}}, hwint = {-5787213829993660416}}} (gdb)
Kaveh, is this still valid?
This hasn't been seen since 4.0.0, closing as fixed. (3.4 is no longer maintained)