This is the mail archive of the
mailing list for the GCC project.
question about the rtx code
- From: Per Fransson <per dot fransson dot 768 at student dot lu dot se>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Wed, 22 May 2002 14:34:04 +0200
- Subject: question about the rtx code
I've got a question about pseudoregisters in the rtx code. If a value is
put in a pseudoregister just before a function call, is it still there
after the call or does it have to be saved on the stack somehow (how?),
i e does it get clobbered ? The reason I'm asking is that I'm trying to
insert calls at certain places in the rtx insn chain and I want to save
some values first. When I use pseudoregisters for saving/restoring the
value, the code is gone in the assemblercode generated; I thought it
might be because the pseudoregisters gets clobbered by the call and the
save/restore code therefore is dead.
I've also tried doing it by inserting the call as an ordinary insn
(*not* a call_insn), hoping I wouldn't clobber any registers that way.
Unfortunately the save/restore code still gets removed, possibly because
the saved hard register *doesn't* get clobbered, making the save/restore
code superfluous. Actually I'd prefer doing it this way of doing it,
since I can then tailor the function I'm calling, i e its register
usage, after my own needs. If I do it like this, how can I clobber the
registers used by the function I'm calling?
I should probably mention that I've tried doing this both during rtx
generation and immediately after the chain has been generated, i e
before any of the other passes that manipulate the rtx code.
I'd appreciate any help I can get.