problem with call clobbered regs

Jim Wilson wilson@specifixinc.com
Thu Feb 12 23:31:00 GMT 2004


Daniel Bayer wrote:
> I already did that. The save and restore instructions are generated by
> the caller-save code as insn 187 and 188 (24.greg). The code that
> calculates the address for the saving is also generated in this pass
> (some time later as insns 230 and 231). But there is no code to
> calculate the address for the restore.

This isn't a complete description of the problem.  What does the RTL 
look like?

I would assume the address was calculated into a pseudo, in which case 
using it across the call is fine.  It should be reg allocated to a 
call-saved register.  Are there any call-saved registers?  If not, that 
could be a problem.  Is there are REG_EQUAL note the insn that 
calculates the address?  If so, then reload could recalculate the 
address after the call.  If the address is in a hard reg instead of a 
pseudo, then why is it in a hard reg?  Who put it in a hard reg, and why 
was it put in a call-clobbered reg?

You will probably have to step through the caller-save code and answer 
these questions.  The caller-save code is not very complicated, so this 
shouldn't be very hard.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list