On Wed, Mar 4, 2015 at 10:44 AM, Terry Guo wrote: > On Mon, Mar 2, 2015 at 9:08 PM, Maxim Kuvyrkov > wrote: >>> On Mar 2, 2015, at 4:44 AM, Terry Guo wrote: >>> >>> Hi there, >>> >>> If target mode isn't specified via either gcc configuration option >>> --with-mode or command line, this patch intends to improve gcc driver to >>> automatically add option -mthumb for thumb-only target. Tested with gcc >>> regression test for various arm targets, no regression. Is it OK? >>> >>> BR, >>> Terry >>> >>> gcc/ChangeLog: >>> >>> 2015-03-02 Terry Guo >>> >>> * common/config/arm/arm-common.c (arm_is_target_thumb_only): New >>> function. >>> * config/arm/arm-protos.h (FL_ Macros): Move to ... >>> * config/arm/arm-opts.h (FL_ Macros): ... here. >>> (struct arm_arch_core_flag): New struct. >>> (arm_arch_core_flags): New array for arch/core and flag map. >>> * config/arm/arm.h (MODE_SET_SPEC_FUNCTIONS): Define new SPEC >>> function. >>> (EXTRA_SPEC_FUNCTIONS): Include new SPEC function. >>> (MODE_SET_SPECS): New SPEC. >>> (DRIVER_SELF_SPECS): Include new SPEC. >> >> Did you consider approach of implementing this purely inside cc1 rather than driver? >> >> We do not seem to need to pass -mthumb to assembler or linker since those will pick up ARM-ness / Thumb-ness from function annotations. Therefore we need to handle -marm / -mthumb for cc1 only. What am I missing? >> >> Also, what's the significance of moving FL_* flags to arm-opts.h? If you had to separate FL_* definitions from the rest of arm-protos.h, then a new dedicated file (e.g., arm-fl.h) would be a better choice for new home of FL_* definitions. >> > > Please find my answers in another email. The attached patch tries to > follow your idea that puts those FL_* into separate file named > arm-flags.h. Does it look good to you? > > BR, > Terry Sorry for missing patch.