public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>,
	 Joern Wolfgang Rennecke <gnu@amylaar.uk>,
	 Claudiu Zissulescu <claziss@synopsys.com>
Subject: Re: GCC arc port defaults to -fcommon
Date: Wed, 07 Jul 2021 12:06:30 +0200	[thread overview]
Message-ID: <87o8bea15l.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAFiYyc1kZZzOa_hn7TaGUZbQhKAVrf8R4kvGS-1oBUkpbr9ifg@mail.gmail.com> (Richard Biener's message of "Wed, 7 Jul 2021 11:58:15 +0200")

* Richard Biener:

> On Wed, Jul 7, 2021 at 11:56 AM Richard Biener
> <richard.guenther@gmail.com> wrote:
>>
>> On Wed, Jul 7, 2021 at 11:00 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>> >
>> > It seems to me that the arc port still defaults to -fcommon, presumably
>> > due to this in gcc/common/config/arc/arc-common.c:
>> >
>> > static void
>> > arc_option_init_struct (struct gcc_options *opts)
>> > {
>> >   opts->x_flag_no_common = 255; /* Mark as not user-initialized.  */
>> >
>> >   /* Which cpu we're compiling for (ARC600, ARC601, ARC700, ARCv2).  */
>> >   arc_cpu = PROCESSOR_NONE;
>> > }
>> >
>> > Is that really necessary?  Is -fno-common broken on arc?
>>
>> It seems arc has -fcommon dependent on !TARGET_NO_SDATA_SET
>> but it should use global_options_set.x_flag_no_common instead of
>> such magic value.
>
> So sth like this (untested):
>
> diff --git a/gcc/common/config/arc/arc-common.c
> b/gcc/common/config/arc/arc-common.c
> index 6a119029616..c8ac7471744 100644
> --- a/gcc/common/config/arc/arc-common.c
> +++ b/gcc/common/config/arc/arc-common.c
> @@ -32,8 +32,6 @@ along with GCC; see the file COPYING3.  If not see
>  static void
>  arc_option_init_struct (struct gcc_options *opts)
>  {
> -  opts->x_flag_no_common = 255; /* Mark as not user-initialized.  */
> -
>    /* Which cpu we're compiling for (ARC600, ARC601, ARC700, ARCv2).  */
>    arc_cpu = PROCESSOR_NONE;
>  }
> diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
> index 69f6ae464e1..b9097b11835 100644
> --- a/gcc/config/arc/arc.c
> +++ b/gcc/config/arc/arc.c
> @@ -1440,7 +1440,7 @@ arc_override_options (void)
>    if (flag_pic)
>      target_flags |= MASK_NO_SDATA_SET;
>
> -  if (flag_no_common == 255)
> +  if (!global_options_set.x_flag_no_common)
>      flag_no_common = !TARGET_NO_SDATA_SET;
>
>    /* Check for small data option */

But this means that arc still defaults to -fcommon with this change,
right?

Thanks,
Florian


  reply	other threads:[~2021-07-07 10:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  8:59 Florian Weimer
2021-07-07  9:56 ` Richard Biener
2021-07-07  9:58   ` Richard Biener
2021-07-07 10:06     ` Florian Weimer [this message]
2021-07-07 12:18       ` Claudiu Zissulescu
2021-07-07 10:06     ` Claudiu Zissulescu

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=87o8bea15l.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=claziss@synopsys.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gnu@amylaar.uk \
    --cc=richard.guenther@gmail.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).