This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Does gcc violate the ia64 ABI?
On Sun, May 18, 2003 at 10:38:55PM -0700, Richard Henderson wrote:
> On Mon, May 19, 2003 at 01:01:39PM +1000, Fergus Henderson wrote:
> > If the ABI can't support tail calls, then I'd say the ABI is broken,
> > and should be replaced, not GCC.
>
> Only tail calls to provably local functions, apparently.
> I think that's pretty stupid, considering how cheap it is
> to reload the gp...
I disagree. Gcc can still do tail calls to external functions as long
as it reloads gp, which gcc is already doing when gp is used after
the call, like in this code
---
extern void bar ();
static void
bar1 ()
{
bar ();
}
extern int x;
void
foo ()
{
bar1 ();
x += 1;
}
---
I think we just need to change the code from
reload_gp = gp is used after the tail call
to
reload_gp = the tail call is external
It may be a win since we won't reload gp for the local call even if
gp is used after the tail call. Besides, you have said reloading gp
is cheap. I don't see fixing gcc will hurt performance.
H.J.