[PATCH] remove HARD_FRAME_POINTER_IS_ARG_POINTER macro

Trevor Saunders tbsaunde@tbsaunde.org
Sun Aug 21 23:01:00 GMT 2016


On Sat, Aug 20, 2016 at 06:46:22PM +0000, Bernd Edlinger wrote:
>  > its kind of silly, and this allows us to remove a few more #ifdefs.
>  >
>  > bootstrapped + regtest x86_64-linux-gnu, ok?
> 
> No, I don't think so, because:
> 
>  >  #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
>  > -#if HARD_FRAME_POINTER_IS_ARG_POINTER
>  > +#if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
>  >    GR_ARG_POINTER = GR_HARD_FRAME_POINTER,
>  >  #else
> 
> will likely break arm and mips.
> The only targets that define HARD_FRAME_POINTER_IS_ARG_POINTER
> probably for some reason.
> 
> see arm.h:
> 
> #define HARD_FRAME_POINTER_REGNUM               \
>    (TARGET_ARM                                   \
>     ? ARM_HARD_FRAME_POINTER_REGNUM              \
>     : THUMB_HARD_FRAME_POINTER_REGNUM)
> 
> #define FRAME_POINTER_REGNUM    102
> 
> #define ARG_POINTER_REGNUM      103
> 
> 
> see mips.h:
> 
> #define ARG_POINTER_REGNUM 77
> #define FRAME_POINTER_REGNUM 78
> 
> #define HARD_FRAME_POINTER_REGNUM \
>    (TARGET_MIPS16 ? GP_REG_FIRST + 17 : GP_REG_FIRST + 30)
> 
> 
> so #if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
> will not be evaluatable by the preprocessor.

For some reason the first time I looked at those macros I thought
TARGET_THUMB / TARGET_MIPS16 were constants, but obviously they aren't.
Anyway I think its easily enough fixed by dropping the rtl.h and config/
changes, the rest should be good I believe.

Trev



More information about the Gcc-patches mailing list