From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id ED857385743B for ; Wed, 7 Jul 2021 10:06:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED857385743B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-298-h1nf94Y5MdqHvC76p5jlpA-1; Wed, 07 Jul 2021 06:06:34 -0400 X-MC-Unique: h1nf94Y5MdqHvC76p5jlpA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E0CD362FA; Wed, 7 Jul 2021 10:06:33 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-115-5.ams2.redhat.com [10.36.115.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 120A41017CE8; Wed, 7 Jul 2021 10:06:31 +0000 (UTC) From: Florian Weimer To: Richard Biener Cc: GCC Development , Joern Wolfgang Rennecke , Claudiu Zissulescu Subject: Re: GCC arc port defaults to -fcommon References: <875yxmbiu3.fsf@oldenburg.str.redhat.com> Date: Wed, 07 Jul 2021 12:06:30 +0200 In-Reply-To: (Richard Biener's message of "Wed, 7 Jul 2021 11:58:15 +0200") Message-ID: <87o8bea15l.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2021 10:06:39 -0000 * Richard Biener: > On Wed, Jul 7, 2021 at 11:56 AM Richard Biener > wrote: >> >> On Wed, Jul 7, 2021 at 11:00 AM Florian Weimer via Gcc 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