This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: (revised) replace statically allocated rtl
- To: Alex Samuel <samuel at codesourcery dot com>
- Subject: Re: PATCH: (revised) replace statically allocated rtl
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 16 Sep 1999 11:21:09 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <199909161754.KAA30077@coriander.orconet.com>
On Thu, Sep 16, 1999 at 10:54:13AM -0700, Alex Samuel wrote:
> ! GR_FRAME_POINTER,
> ! /* For register elimination to work properly these hard_frame_pointer_rtx,
> ! frame_pointer_rtx, and arg_pointer_rtx must be the same if they refer to
> ! the same register. */
> ! #if HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM
> ! GR_HARD_FRAME_POINTER = GR_FRAME_POINTER,
> ! #else
> ! GR_HARD_FRAME_POINTER,
> ! #endif
> ! #if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
> ! GR_ARG_POINTER = GR_FRAME_POINTER,
> ! #else
> ! #if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
> ! GR_ARG_POINTER = GR_HARD_FRAME_POINTER,
> ! #else
> ! GR_ARG_POINTER,
> ! #endif
> ! #endif
> ! GR_VIRTUAL_INCOMING_ARGS,
These need to be reordered. Consider HFP != FP and AP == FP
(there are no examples of this in the compiler, but What If)
we get
GR_FRAME_POINTER,
GR_HARD_FRAME_POINTER,
GR_ARG_POINTER = GR_FRAME_POINTER,
GR_VIRTUAL_INCOMING_ARGS,
which will define GR_VIRTUAL_INCOMING_ARGS == GR_HARD_FRAME_POINTER.
> + #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
> + hard_frame_pointer_rtx = gen_rtx_raw_REG (Pmode, HARD_FRAME_POINTER_REGNUM);
> + #endif
> + #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
> + arg_pointer_rtx = gen_rtx_raw_REG (Pmode, ARG_POINTER_REGNUM);
> + #endif
Here, I think something like
if (! arg_pointer_rtx)
arg_pointer_rtx = ...
would be easier to read.
The rest looks good.
r~