[Bug middle-end/49519] [4.7 Regression] Revision 175272 miscompiled 447.dealII in SPEC CPU 2006
ebotcazou at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 12 08:43:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49519
--- Comment #30 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-07-12 08:42:40 UTC ---
> This patch seems too conservative and it appears that it will cause the
> compiler to miss all tailcalls with pointer arguments. It only matters if the
> register points to the incoming parameters, which can only happen in unusual
> cases. We should be able to determine that reliably.
This is a bit of an overstatement though, as
extern int foo (int, int *);
int i;
int bar (int a, int b)
{
int *p = &i;
return foo (a, p);
}
will be caught. Even this
extern int foo (int, int);
int i;
int bar (int a, int b)
{
int *p = &i;
return foo (a, *p);
}
will be caught thanks to alias analysis at the Tree level.
As for the "reliably", this time it's a little optimistic IMO. :-) But we can
probably be less conservative with more work.
More information about the Gcc-bugs
mailing list