Bug 19750 - [3.4] failure in gcc.dg/titype-1.c
Summary: [3.4] failure in gcc.dg/titype-1.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.4
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-02-02 03:31 UTC by Kaveh Ghazi
Modified: 2008-01-25 20:56 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail: 3.4.6
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaveh Ghazi 2005-02-02 03:32:00 UTC
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;
}
Comment 1 Andrew Pinski 2005-02-02 06:53:18 UTC
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.
Comment 2 Kaveh Ghazi 2005-12-31 14:14:17 UTC
still fails with checking here:
http://gcc.gnu.org/ml/gcc-testresults/2005-12/msg01585.html

Comment 3 Kaveh Ghazi 2005-12-31 14:21:58 UTC
Apparently fails without checking too:

http://gcc.gnu.org/ml/gcc-testresults/2005-12/msg01501.html
Comment 4 Kaveh Ghazi 2005-12-31 14:44:36 UTC
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)
Comment 5 Manuel López-Ibáñez 2007-11-14 02:29:47 UTC
Kaveh, is this still valid?
Comment 6 Richard Biener 2008-01-25 20:56:47 UTC
This hasn't been seen since 4.0.0, closing as fixed.  (3.4 is no longer maintained)