public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Terry Guo <flameroc@gmail.com>
To: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Cc: Terry Guo <terry.guo@arm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
		Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH][ARM]Automatically add -mthumb for thumb-only target when mode isn't specified
Date: Wed, 04 Mar 2015 02:45:00 -0000	[thread overview]
Message-ID: <CAGbRaL5S6OYwa-J8s6jbxHYEYBtd18r5U4mSy4qe3yVuwjUZMg@mail.gmail.com> (raw)
In-Reply-To: <0E847550-2947-46C3-991C-2720641BC881@linaro.org>

On Mon, Mar 2, 2015 at 9:08 PM, Maxim Kuvyrkov
<maxim.kuvyrkov@linaro.org> wrote:
>> On Mar 2, 2015, at 4:44 AM, Terry Guo <terry.guo@arm.com> 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  <terry.guo@arm.com>
>>
>>        * 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.<gcc-mthumb-option-v5.txt>
>
> 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

  parent reply	other threads:[~2015-03-04  2:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02  1:45 Terry Guo
2015-03-02 13:08 ` Maxim Kuvyrkov
2015-03-02 13:29   ` James Greenhalgh
2015-03-02 16:14     ` Kyrill Tkachov
2015-03-03  2:28   ` Terry Guo
2015-03-04  2:45   ` Terry Guo [this message]
2015-03-04  2:46     ` Terry Guo
2015-03-04  8:16       ` Maxim Kuvyrkov
2015-03-05  6:14         ` Terry Guo
2015-03-05  7:02           ` Maxim Kuvyrkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGbRaL5S6OYwa-J8s6jbxHYEYBtd18r5U4mSy4qe3yVuwjUZMg@mail.gmail.com \
    --to=flameroc@gmail.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=ramana.radhakrishnan@arm.com \
    --cc=terry.guo@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).