On Tue, Sep 20, 2016 at 05:30:36PM +0200, Bernd Schmidt wrote:
> On 09/20/2016 05:18 PM, Jeff Law wrote:
> > > I assume HARD_FRAME_POINTER_REGNUM is never zero.
> > It could be zero.  It's just a hard register number.  No target has the
> > property that its hard frame pointer register is 0 though :-)
> 
> git blame to the rescue. The current state comes from one of tbsaunde's
> cleanup patches:
> 
> > diff --git a/gcc/regrename.c b/gcc/regrename.c
> index 174d3b5..e5248a5 100644
> --- a/gcc/regrename.c
> +++ b/gcc/regrename.c
> @@ -442,12 +442,10 @@ rename_chains (void)
>         continue;
> 
>        if (fixed_regs[reg] || global_regs[reg]
> -#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
> -         || (frame_pointer_needed && reg == HARD_FRAME_POINTER_REGNUM)
> -#else
> -         || (frame_pointer_needed && reg == FRAME_POINTER_REGNUM)
> -#endif
> -         )
> +         || (!HARD_FRAME_POINTER_IS_FRAME_POINTER && frame_pointer_needed
> +             && reg == HARD_FRAME_POINTER_REGNUM)
> +         || (HARD_FRAME_POINTER_REGNUM && frame_pointer_needed
> +             && reg == FRAME_POINTER_REGNUM))
>         continue;
> 
>        COPY_HARD_REG_SET (this_unavailable, unavailable);
> 
> Looks like it never got reviewed and was committed as preapproved.

I thought I remember discussing this macro with you, but see what was
checked in I'll believe I'm thinking of something similar but different.
Any way sorry about the dumb bug, though in my defense, or perhaps in
further proof I'm not good at detail I missed the
HARD_FRAME_POINTER_REGNUM instead of HARD_FRAME_POINTER_IS_FRAME_POINTER
the first time I looked at it here too :"(

> The #ifdef we had before looks odd too. Maybe this should just read
> 
>  if (fixed_regs[reg] || global_regs[reg]
>      || (frame_pointer_needed && reg == HARD_FRAME_POINTER_REGNUM))

I'd agree that sounds reasonable.  Though I'd want to check for a target
where HARD_FRAME_POINTER_IS_FRAME_POINTER is true, but
HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM, though that could
only be arm or mips I believe and it sounds pretty bogus.

Thanks for fixing that up for me!

Trev

> 
> 
> Bernd

Reply via email to