This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why is there no arg_pointer_needed?
- From: Ian Lance Taylor <ian at airs dot com>
- To: Ãyvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 30 Jan 2005 23:52:45 -0500
- Subject: Re: Why is there no arg_pointer_needed?
- References: <1107031748.15814.10.camel@localhost.localdomain>
Ãyvind Harboe <oyvind.harboe@zylin.com> writes:
> I'm trying to understand what ensures that the frame pointer will not be
> eliminated in the case that the frame pointer is not needed, but the
> argument pointer relies on the frame pointer because the argument
> pointer failed to be eliminated to the stack pointer.
>
> This could potentially be a problem in an elimination scheme where
> FRAME/ARG_POINTER_REGNUM are two fake registers that either get
> eliminated to the stack or frame pointer.
>
> #define ELIMINABLE_REGS { \
> {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
> {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
> {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
> {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM} \
> }
>
> #define CAN_ELIMINATE(FROM, TO) 1
In general init_elim_table() will reject attempts to eliminate to the
stack pointer when frame_pointer_needed is true. In other cases, it
will eliminate to the stack pointer. So it seems that if you can't
eliminate the argument pointer to the stack pointer, then the frame
pointer must be needed; there is no other reason that the elimination
would fail. Perhaps you didn't notice the assignment to
frame_pointer_needed in that function? Otherwise I think you need to
further explain what you are asking.
Ian