On Mon, Apr 3, 2017 at 12:32 PM, Sebastian Huber <sebastian.hu...@embedded-brains.de> wrote: > Allow targets to define the default for the short enums option. > > gcc/ > > * config/arm/arm.c: (ARM_DEFAULT_SHORT_ENUMS): Provide default > definition. > * config/arm/rtems.h (ARM_DEFAULT_SHORT_ENUMS) Define. > --- > gcc/config/arm/arm.c | 6 +++++- > gcc/config/arm/rtems.h | 2 ++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c > index b24143e..33d3834 100644 > --- a/gcc/config/arm/arm.c > +++ b/gcc/config/arm/arm.c > @@ -26547,11 +26547,15 @@ arm_promote_function_mode (const_tree type > ATTRIBUTE_UNUSED, > } > > /* AAPCS based ABIs use short enums by default. */ > +#ifndef ARM_DEFAULT_SHORT_ENUMS > +#define ARM_DEFAULT_SHORT_ENUMS \ > + (TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX) > +#endif
This belongs in arm.h rather than in arm.c > > static bool > arm_default_short_enums (void) > { > - return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX; > + return ARM_DEFAULT_SHORT_ENUMS; > } > > > diff --git a/gcc/config/arm/rtems.h b/gcc/config/arm/rtems.h > index 53cd987..b34bbe8 100644 > --- a/gcc/config/arm/rtems.h > +++ b/gcc/config/arm/rtems.h > @@ -27,3 +27,5 @@ > builtin_assert ("system=rtems"); \ > TARGET_BPABI_CPP_BUILTINS(); \ > } while (0) > + > +#define ARM_DEFAULT_SHORT_ENUMS false It's a change in ABI for the RTEMS platform but it certainly needs a documentation update in the release notes . Also, is it necessary that you need this in for GCC-7 or can you wait for stage-1 since we are in regression fixes mode ? Ramana > -- > 1.8.4.5 >