This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/49519] [4.7 Regression] Revision 175272 miscompiled 447.dealII in SPEC CPU 2006
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jul 2011 08:43:28 +0000
- Subject: [Bug middle-end/49519] [4.7 Regression] Revision 175272 miscompiled 447.dealII in SPEC CPU 2006
- Auto-submitted: auto-generated
- References: <bug-49519-4@http.gcc.gnu.org/bugzilla/>
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.