This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/41089] [4.5 Regression] r147980 (New SRA) breaks stdargs



------- Comment #15 from ubizjak at gmail dot com  2009-09-10 08:48 -------
This is the test that still fails:

--cut here--
extern void abort (void);

int foo_arg;
long x;

static void
foo (int v, __builtin_va_list ap)
{
  switch (v)
    {
    case 5: foo_arg = __builtin_va_arg(ap,int); break;
    default: abort ();
    }
}

void
f4 (int i, ...)
{
  __builtin_va_list ap;

  __builtin_va_start(ap,i);
  x = __builtin_va_arg(ap,double);
  foo (i, ap);
  __builtin_va_end(ap);
}

int
main (void)
{
f4 (5, 16.0, 128);
  if (x != 16 || foo_arg != 128)
    abort ();
return 0;
}
--cut here--

The failure is triggered when foo() is inlined into f4(), so with above test we
fail also at -O2.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41089


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]