This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How can INITIAL_FRAME_POINTER_OFFSET be made correct?


On Mon, Mar 22, 2004 at 03:04:20PM -0000, Dave Korn wrote:
> > I don't suppose your link register is marked CALL_USED?  
> 
>   Turns out it certainly is, or at any rate it fixes my va-arg-11.c failure
> and several others too.  I'm not sure why it's a mistake, though: function
> calls are performed by a jump-and-link instruction that clobbers the LR; in
> the definition of CALL_USED_REGISTERS in the documentation, it seems to
> suggest that means I should include it.  Is it wrong because that counts as
> being clobbered by the caller, rather than by the callee, perhaps?

It's wrong because any function that clobbers the link register is
very likely to need to save the link register so that it can be 
restored for the return.

Not looking at sources, but I can well imagine that reload has an
optimization that says that it needn't go back through the allocation
loop if the new register it chose to use is call clobbered.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]