From patchwork Wed Oct 4 22:19:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Sayle X-Patchwork-Id: 1843665 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nextmovesoftware.com header.i=@nextmovesoftware.com header.a=rsa-sha256 header.s=default header.b=ArTdl1vT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S18J92yx5z1yq9 for ; Thu, 5 Oct 2023 09:19:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 686AF3857716 for ; Wed, 4 Oct 2023 22:19:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 3AA4B3858D3C for ; Wed, 4 Oct 2023 22:19:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AA4B3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AyLmLCuRVd0Wy3I91kVpmQuMYyO5y2KBj4a/lzSLwjQ=; b=ArTdl1vT7R0WLn4vMLKlSLSnmI 7+STepjhx9gCf4XcxcDBHlO7URxG/VA8qWAb210TTQtjzipSihzZoHA2rwQSx0shgXt4sx2765xEq xEY2lUXuoA2DBB5yFtuEL7a0IIRMsqa9v180uPWTIkP4sGSMyilzmjk0j8oC/5wTecWuJ+cNBuK0n 5DZCXxw8txt631Du/Oafor11rOUPvfrEE1St2UaXaHNAvZXtC9eESyh5trvOiuARU6erq3T5i85MB WtrVKvn1n1Z7rCi8pNK4AabWZTVyQqPIYlktgJx2h7v7EretdcCalv2ale4cgNCZZmhR/AfDF0Xpi NbqDGZZg==; Received: from host86-160-20-38.range86-160.btcentralplus.com ([86.160.20.38]:57022 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qoADQ-0005FZ-1j; Wed, 04 Oct 2023 18:19:36 -0400 From: "Roger Sayle" To: Cc: "'Richard Sandiford'" Subject: [PATCH] Support g++ 4.8 as a host compiler. Date: Wed, 4 Oct 2023 23:19:33 +0100 Message-ID: <012a01d9f710$db84ef40$928ecdc0$@nextmovesoftware.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: Adn3ECQ34nFIYqKCRleIunJYK1XO+g== X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The recent patch to remove poly_int_pod triggers a bug in g++ 4.8.5's C++ 11 support which mistakenly believes poly_uint16 has a non-trivial constructor. This in turn prohibits it from being used as a member in a union (rtxunion) that constructed statically, resulting in a (fatal) error during stage 1. A workaround is to add an explicit constructor to the problematic union, which allows mainline to be bootstrapped with the system compiler on older RedHat 7 systems. This patch has been tested on x86_64-pc-linux-gnu where it allows a bootstrap to complete when using g++ 4.8.5 as the host compiler. Ok for mainline? 2023-10-04 Roger Sayle gcc/ChangeLog * rtl.h (rtx_def::u): Add explicit constructor to workaround issue using g++ 4.8 as a host compiler. diff --git a/gcc/rtl.h b/gcc/rtl.h index 6850281..a7667f5 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -451,6 +451,9 @@ struct GTY((desc("0"), tag("0"), struct fixed_value fv; struct hwivec_def hwiv; struct const_poly_int_def cpi; +#if defined(__GNUC__) && GCC_VERSION < 5000 + u () {} +#endif } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u; };