On Tuesday 24 May 2016 18:00:27 Kyrill Tkachov wrote: > Hi Thomas, > > On 10/05/16 14:26, Thomas Preudhomme wrote: > > Hi, > > > > ARM_ARCH_ISA_THUMB is currently set to 1 when compiling for armv5 despite > > armv5 not supporting Thumb instructions (armv5t does): > > > > arm-none-eabi-gcc -dM -march=armv5 -E - < /dev/null | grep ISA_THUMB > > #define __ARM_ARCH_ISA_THUMB 1 > > > > The reason is TARGET_ARM_ARCH_ISA_THUMB being set to 1 if target does not > > support Thumb-2 and is ARMv4T, ARMv5 or later. This patch replaces that > > logic by checking whether the given architecture has the right feature > > bit (FL_THUMB). > > > > ChangeLog entry is as follows: > > > > > > *** gcc/ChangeLog *** > > > > 2016-05-06 Thomas Preud'homme <thomas.preudho...@arm.com> > > > > * config/arm/arm-protos.h (arm_arch_thumb): Declare. > > * config/arm/arm.c (arm_arch_thumb): Define. > > (arm_option_override): Initialize arm_arch_thumb. > > * config/arm/arm.h (TARGET_ARM_ARCH_ISA_THUMB): Use > > arm_arch_thumb to > > determine if target support Thumb-1 ISA. > > > > diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h > > index > > d8179c441bb53dced94d2ebf497aad093e4ac600..4d11c91133ff1b875afcbf58abc4491c > > 2c93768e 100644 > > --- a/gcc/config/arm/arm-protos.h > > +++ b/gcc/config/arm/arm-protos.h > > @@ -603,6 +603,9 @@ extern int arm_tune_cortex_a9; > > > > interworking clean. */ > > > > extern int arm_cpp_interwork; > > > > +/* Nonzero if chip supports Thumb. */ > > +extern int arm_arch_thumb; > > + > > Bit of bikeshedding really, but I think a better name would be > arm_arch_thumb1. > This is because we also have the macros TARGET_THUMB and TARGET_THUMB2 > where TARGET_THUMB2 means either Thumb-1 or Thumb-2 and a casual reader > might think that arm_arch_thumb means that there is support for either.
It kind of is in the sense that Thumb-2 also includes Thumb-1 instructions so an architecture with FL_THUMB2 would also have FL_THUMB. > > Also, please add a simple test that compiles something with -march=armv5 > (plus -marm) and checks that __ARM_ARCH_ISA_THUMB is not defined. Ack. > > Ok with that change and the test. > > Thanks, > Kyrill > > P.S. I think your mailer sometimes mangles long lines in the patches > (for example the git hash headers). Can you please send your patches as > attachments? That will also make it easier for me to extract and apply > them to my tree without having to manually select the inlined patch > from the message. Will do. I thought inline was preferred to easily do inline review. Best regards, Thomas