Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Stack bias



On Tue, 11 Aug 2009 04:44:14 -0400 (EDT)
der Mouse <mouse%Rodents-Montreal.ORG@localhost> wrote:

> >> "Without stack" != "using %o6 as a stack pointer".  Leaf routines
> >> may very well need %sp for nothing at all - everything they need of
> >> the stack may come off %fp.
> > They can instead use %fp for whatever they like, but need to leave
> > %sp untouched.
> 
> ...?!
> 
> The one that's shared with another stack frame can be scribbled on,
> but the one that's not must not be?
> 
> That's pretty seriously twisted.  Do you have any idea why such a
> bizarre design was chosen for the ABI?
> 
> It seems to me this also means that the "low bit of %o6" test is not
> safe.  The scenario: routine A calls (leaf) routine B, and B scribbles
> on (its) %fp.  When B returns, for at least one instruction, A's %sp
> will be whatever trash B left there; an interrupt during that interval
> is likely to destroy the high halves of all A's registers.  But if I
> can think of this in thirty seconds, ABI designers surely can with all
> the time at their disposal, so I must be missing something.  What?

I don't think leaf subroutines are allowed to change %fp or %sp
registers.


Home | Main Index | Thread Index | Old Index