From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id EDE693858C83 for ; Sat, 22 Apr 2023 17:37:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EDE693858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9484F21A00; Sat, 22 Apr 2023 17:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682185051; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TvdGnzde2NY3g7CYGRUtSqV3Q9j3mwfwcrkyrc1Fz6g=; b=F8lL++N4qCDN1q0wJViPRAw6WzBveMjOrovEBCUP4Z7lpIcY23MwmNazKo81JzGK8o85fo Vj1Hwez8cXtYFIGxvG93jbpoAHCbxIcR2v1mkns+20gNtN7rkNeBR4Pw6zOEFJnveMM0Hh xKuYmOZ0WR+3yLLVfyO9ttah00/YJCc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682185051; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TvdGnzde2NY3g7CYGRUtSqV3Q9j3mwfwcrkyrc1Fz6g=; b=kb7WizBO0t4zHdGwxKZxg+ri3a8RtpgpWkWcCKOoFXnr4ePBoIh2xZBovfCcNlmBcM1Kms ozDvyxH6A+EIQLBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8346613499; Sat, 22 Apr 2023 17:37:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zc8AIFsbRGQIfQAAMHmgww (envelope-from ); Sat, 22 Apr 2023 17:37:31 +0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] Fix up bootstrap with GCC 4.[89] after RAII auto_mpfr and autp_mpz [PR109589] Date: Sat, 22 Apr 2023 19:37:20 +0200 Message-Id: <6FEF5A42-DB56-48BC-B28E-030313BC822E@suse.de> References: Cc: gcc-patches@gcc.gnu.org In-Reply-To: To: Jakub Jelinek X-Mailer: iPhone Mail (20E252) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Am 22.04.2023 um 10:03 schrieb Jakub Jelinek : >=20 > =EF=BB=BFHi! >=20 >> On Tue, Apr 18, 2023 at 03:39:41PM +0200, Richard Biener via Gcc-patches w= rote: >> The following adds two RAII classes, one for mpz_t and one for mpfr_t >> making object lifetime management easier. Both formerly require >> explicit initialization with {mpz,mpfr}_init and release with >> {mpz,mpfr}_clear. >=20 > This unfortunately broke bootstrap when using GCC 4.8.x or 4.9.x as > it uses deleted friends which weren't supported until PR62101 fixed > them in 2014 for GCC 5. >=20 > The following patch adds an workaround, not deleting those friends > for those old versions. > While it means if people add those mp*_{init{,2},clear} calls on auto_mp* > objects they won't notice when doing non-bootstrap builds using > very old system compilers, people should be bootstrapping their changes > and it will be caught during bootstraps even when starting with those > old compilers, plus most people actually use much newer compilers > when developing. >=20 > Bootstrapped/regtested on x86_64-linux and i686-linux (with gcc 12.1.1 > as system compiler) and powerpc64-linux and powerpc64le-linux (with gcc > 4.8.5 as system compiler, where it previously failed bootstrap). > Ok for trunk? Ok > 2023-04-22 Jakub Jelinek >=20 > PR bootstrap/109589 > * system.h (class auto_mpz): Workaround PR62101 bug in GCC 4.8 and 4.9.= > * realmpfr.h (class auto_mpfr): Likewise. >=20 > --- gcc/system.h.jj 2023-04-20 09:36:09.097375720 +0200 > +++ gcc/system.h 2023-04-21 20:13:09.212049563 +0200 > @@ -714,8 +714,11 @@ public: > auto_mpz (const auto_mpz &) =3D delete; > auto_mpz &operator=3D (const auto_mpz &) =3D delete; >=20 > +#if GCC_VERSION < 4008 || GCC_VERSION >=3D 5000 > + /* GCC 4.8 and 4.9 don't support this, only fixed in PR62101 for 5.0. *= / > friend void mpz_clear (auto_mpz&) =3D delete; > friend void mpz_init (auto_mpz&) =3D delete; > +#endif >=20 > private: > mpz_t m_mpz; > --- gcc/realmpfr.h.jj 2023-04-20 09:36:09.066376175 +0200 > +++ gcc/realmpfr.h 2023-04-21 20:13:36.191663089 +0200 > @@ -37,9 +37,12 @@ public: > auto_mpfr (const auto_mpfr &) =3D delete; > auto_mpfr &operator=3D (const auto_mpfr &) =3D delete; >=20 > +#if GCC_VERSION < 4008 || GCC_VERSION >=3D 5000 > + /* GCC 4.8 and 4.9 don't support this, only fixed in PR62101 for 5.0. *= / > friend void mpfr_clear (auto_mpfr&) =3D delete; > friend void mpfr_init (auto_mpfr&) =3D delete; > friend void mpfr_init2 (auto_mpfr&, mpfr_prec_t) =3D delete; > +#endif >=20 > private: > mpfr_t m_mpfr; >=20 >=20 > Jakub >=20