This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/41089] [4.5 Regression] r147980 (New SRA) breaks stdargs
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2009 08:48:30 -0000
- Subject: [Bug tree-optimization/41089] [4.5 Regression] r147980 (New SRA) breaks stdargs
- References: <bug-41089-1649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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