From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id DDA43383B83C for ; Mon, 5 Jul 2021 13:23:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DDA43383B83C Received: by mail-ed1-x530.google.com with SMTP id y40so8521527ede.4 for ; Mon, 05 Jul 2021 06:23:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=a3a9F5llFlvkYkMKtXikqE1RWBhQnP1eajK6NM74fuk=; b=WfeLK6o4sgbB+L7mjpFoPQaSFRYQeO/CXRc5RPFfxwX9/QOgTjxq0iyZiRarDZbC2+ 7QxsytjuQxoelA2kP+vwG3BENtDSShpaYFW8JKAzm61ncyKaZUmce6vy5xPuLqvsqO93 URYdQDtlR5VTNUKGRszME+29M0XHheDiRV6D0wVxt3/7vJrRkqIV0oj6YpEEZVd6PU4P AmR5ta1zhlH+WK5idDLGJ27W4qlHjLBCcOfpHb1pfedXPnHJxyI73DHSH2pSK9m6nnBz vehKnlsPrqehUHc5d7Huh2SgCCimKXKbUW0m3CK1X1NcASOjNgoX3iaZrsFx/MbtZo2Z 0ExQ== X-Gm-Message-State: AOAM530ZK3p/y7HFDKJFCYO9tVxMcwC3I+OAMAvzwejpR4EmgJk2XKbd lxZrvN90UsNwFQt3StyreLQTFCFPy+/APnf4g2FOAwwyObY= X-Google-Smtp-Source: ABdhPJzWH7r6wowtur+etifqFPGGCHhgB/FMCl0ckx0ZtPdLghoWMG12V01w9bhui6QIJRwLbVFJ2dtfmTM0P1Sw9Cg= X-Received: by 2002:a05:6402:42c9:: with SMTP id i9mr16245755edc.61.1625491400987; Mon, 05 Jul 2021 06:23:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Mon, 5 Jul 2021 15:23:09 +0200 Message-ID: Subject: Re: [PATCH] X86: Provide a CTOR for stringop_algs [PR100246]. To: Iain Sandoe Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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:23:23 -0000 On Mon, Jul 5, 2021 at 3:04 PM Iain Sandoe wrote: > > Hi Richard, > > > On 5 Jul 2021, at 11:50, Richard Biener via Gcc-patches wrote: > > > > 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. > >> > >> (although the PR mentions clang, specifically, this has also been repo= rted > >> for some GCC versions within the range that should be able to bootstra= p > >> GCC) > >> > >> There are several possible solutions proposed in the PR, this one seem= s > >> the least invasive. > >> > >> The header is pulled into the gcov code that builds with C, so we have= to > >> make the CTOR conditional on C++. > >> > >> tested on Darwin12 with xcode-6, bootstrapped on x86_64-darwin and lin= ux. > >> OK for master / GCC-11? > > > > 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 somet= hing 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 strin= gop_algs > > type? > > I don=E2=80=99t think that will work because it=E2=80=99s in a header tha= t=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, t= he conditional is > only there because the same header is compiled by C and C++. Whoops sorry - I was confused. The patch looks OK to me if you add a comme= nt before the CTOR why it was added (maybe quoting the error that happens) Richard. > thanks > Iain > > > >> thanks > >> Iain > >> > >> Signed-off-by: Iain Sandoe > >> > >> PR bootstrap/100246 - [11/12 Regression] GCC will not bootstrap with c= lang 3.4/3.5 [xcode 5/6, Darwin 12/13] > >> > >> PR bootstrap/100246 > >> > >> gcc/ChangeLog: > >> > >> * config/i386/i386.h (struct stringop_algs): Define a CTOR for > >> this type. > >> --- > >> gcc/config/i386/i386.h | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >> 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 lib= call, > >> + int _noalign =3D false) > >> + : max (_max), alg (_alg), noalign (_noalign) {} > >> +#endif > >> const int max; > >> const enum stringop_alg alg; > >> int noalign; > >> -- > >> 2.24.1 >