This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: problem with call clobbered regs
On Wed, Feb 11, 2004 at 07:02:17PM -0800, Jim Wilson wrote:
> Daniel Bayer wrote:
> >I'm writing a new backend for gcc. At the moment I have a problem with
> >call clobbered regs. For a certain input it generates this code:
>
> This is most likely a problem with your port. It is difficult to help
> when no info is available about the port.
I know. I just wanted to make sure that this is no common error or a
known bug.
> You might check to make sure %p3 is mentioned as a call clobbered
> register.
There is a 1 for this register in CALL_USED_REGISTERS. I think that if
%p3 wasn't a call clobbered register then the compiler would have used
%p3 instead of %p2 to hold the value.
Maybe the knowledge of %p3 being clobbered doesn't propagate far
enough.
> You can use the -da option to dump rtl after every optimization pass.
> You can examine the rtl dumps to determine in which optimization pass
> the problem first occurs.
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.
Daniel