------- 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