Tom de Vries <tom_devr...@mentor.com> writes:
> * The set of registers which are clobbered during a call by things like the 
> plt
>    - these are not picked up by the use-caller-save optimization. We need the
>    hook to inform the compiler about these registers

Right, but...

> * And finally, registers clobbered in the caller itself during a sequence of
>    instructions implementing a function call. On mips, that's R6, which may be
>    clobbered by the call. Normally that doesn't need mentioning in the RTL 
> since
>    it's a call_used_reg, but since use-caller-save might discover a set of
>    registers for the called function that does not include R6, it becomes
>    important to record this clobber explicitly. It could be represented in the
>    RTL by a clobber on the insn, or a clobber in C_I_F_U. Or it could just be
>    part of the registers returned by the hook - but that was previously deemed
>    not acceptable (and it doesn't match the description of the hook).

...why do we need two different mechanisms to deal with these two?
IMO the set recorded for the callee should contain what the callee
instructions clobber and nothing else.  CALL_INSN_FUNCTION_USAGE
should contain everything clobbered by a call outside the callee,
whether that's in the calling function itself, in a PLT, in a MIPS16
stub, or whatever.

Thanks,
Richard

Reply via email to