From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id B0B463854832 for ; Mon, 10 May 2021 08:49:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0B463854832 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: (qmail 69565 invoked from network); 10 May 2021 08:49:26 -0000 X-APM-Out-ID: 16206365666956 X-APM-Authkey: 257869/1(257869/1) 3 Received: from unknown (HELO ?192.168.1.212?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 10 May 2021 08:49:26 -0000 Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: RFC: Changing AC_PROG_CC to AC_PROG_CC_C99 in top level configure From: Iain Sandoe In-Reply-To: <20210505072052.GA14297@bubble.grove.modra.org> Date: Mon, 10 May 2021 09:49:25 +0100 Cc: GCC Patches , "H.J. Lu" Content-Transfer-Encoding: 7bit Message-Id: References: <8c1b0ed9-e6f3-9c22-45c5-c2680a2a4830@polymtl.ca> <3e562764-ce93-d4a2-fbba-dc622c9b5bb7@redhat.com> <3c76d8a1-d029-237d-054c-0ff65eb063cb@polymtl.ca> <20210505001825.GN22624@bubble.grove.modra.org> <20210505072052.GA14297@bubble.grove.modra.org> To: Alan Modra X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-16.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2021 08:49:29 -0000 Alan Modra wrote: > On Wed, May 05, 2021 at 08:05:29AM +0100, Iain Sandoe wrote: >> Alan Modra via Gcc-patches wrote: >>> diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h >>> index 97d6f3863cb..cc3b1b6d666 100644 >>> --- a/gcc/config/i386/i386.h >>> +++ b/gcc/config/i386/i386.h >>> @@ -73,8 +73,8 @@ struct stringop_algs >>> { >>> const enum stringop_alg unknown_size; >>> const struct stringop_strategy { >>> - const int max; >>> - const enum stringop_alg alg; >>> + int max; >>> + enum stringop_alg alg; >>> int noalign; >>> } size [MAX_STRINGOP_ALGS]; >>> }; >> >> does this relate to / fix PR 100246 (which seems to fire for some GCC >> versions as well >> as older clang)? > > Yes, looks like the same issue. I started making a similar fix to the > one you attached to the PR, then laziness kicked in after noticing the > errors were only given on the const elements. I added a third variant to the PR (as below), which preserves the const-ness but provides a CTOR. TBH, I have no especial preference for the solution, but it would be nice to commit one of them :-) cheers Iain The condition is because this header gets pulled in by gcov stuff which is built with a C compiler. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 97d6f38..a417c93 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -73,6 +73,11 @@ struct stringop_algs { const enum stringop_alg unknown_size; const struct stringop_strategy { +#ifdef __cplusplus + stringop_strategy(int _max = -1, enum stringop_alg _alg = libcall, + int _noalign = false) + : max (_max), alg (_alg), noalign (_noalign) {} +#endif const int max; const enum stringop_alg alg; int noalign;