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 BD121386EC49 for ; Mon, 5 Jul 2021 13:04:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD121386EC49 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 47476 invoked from network); 5 Jul 2021 13:04:19 -0000 X-APM-Out-ID: 16254902594747 X-APM-Authkey: 257869/1(257869/1) 2 Received: from unknown (HELO ?192.168.1.214?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 5 Jul 2021 13:04:19 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [PATCH] X86: Provide a CTOR for stringop_algs [PR100246]. From: Iain Sandoe In-Reply-To: Date: Mon, 5 Jul 2021 14:04:19 +0100 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Richard Biener X-Mailer: Apple Mail (2.3445.104.21) X-Spam-Status: No, score=-16.1 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 05 Jul 2021 13:04:22 -0000 Hi Richard, > On 5 Jul 2021, at 11:50, Richard Biener via Gcc-patches = wrote: >=20 > On Sun, Jul 4, 2021 at 10:04 PM Iain Sandoe wrote: >> Several older compilers fail to build modern GCC because of missing >> or incomplete C++11 support. >>=20 >> (although the PR mentions clang, specifically, this has also been = reported >> for some GCC versions within the range that should be able to = bootstrap >> GCC) >>=20 >> There are several possible solutions proposed in the PR, this one = seems >> the least invasive. >>=20 >> The header is pulled into the gcov code that builds with C, so we = have to >> make the CTOR conditional on C++. >>=20 >> tested on Darwin12 with xcode-6, bootstrapped on x86_64-darwin and = linux. >> OK for master / GCC-11? >=20 > Hmm, what is specifically built with a C compiler? gcov.c not, I = think. any C compilation that includes tm.h well, libgcc2 fails too on a quick check here - but ISTR there was = something in libgcov and I checked with Martin that it was intentionally compiled = with C compiler. > Instead of commenting the CTOR, does it work to comment the whole = stringop_algs > type? I don=E2=80=99t think that will work because it=E2=80=99s in a header = that=E2=80=99s transitively included by tm.h which is then included loads of places. > Also it seems on trunk this CTOR is no more? The addition of the CTOR is the fix for the C++ compile fail in the PR, = the conditional is only there because the same header is compiled by C and C++. thanks Iain >=20 >> thanks >> Iain >>=20 >> Signed-off-by: Iain Sandoe >>=20 >> PR bootstrap/100246 - [11/12 Regression] GCC will not bootstrap with = clang 3.4/3.5 [xcode 5/6, Darwin 12/13] >>=20 >> PR bootstrap/100246 >>=20 >> gcc/ChangeLog: >>=20 >> * config/i386/i386.h (struct stringop_algs): Define a CTOR for >> this type. >> --- >> gcc/config/i386/i386.h | 5 +++++ >> 1 file changed, 5 insertions(+) >>=20 >> diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h >> index 6e0340a4b60..84151156999 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 =3D -1, enum stringop_alg _alg =3D = libcall, >> + int _noalign =3D false) >> + : max (_max), alg (_alg), noalign (_noalign) {} >> +#endif >> const int max; >> const enum stringop_alg alg; >> int noalign; >> -- >> 2.24.1