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: 148605 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp435792vqb; Wed, 4 Oct 2023 15:20:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsxmPxGNFiLCuTdc4LR6AjOxL8jXAwohTJCu7po2sdZCENdoSf0NOfDCGmUOm0ML9u1qsn X-Received: by 2002:adf:f98f:0:b0:323:302f:aabb with SMTP id f15-20020adff98f000000b00323302faabbmr3260060wrr.64.1696458010426; Wed, 04 Oct 2023 15:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696458010; cv=none; d=google.com; s=arc-20160816; b=kXv0YC9rvYoyJ1GpSsxHG36eBwtXHmmQCjzgh6nQ4JAp3PhqqTbGWeDCQr3SgGi6Z9 +zaMrEy8q2Uf5BKrWhml8jpfRXPnQDAU1ULT7siww+aMZlNi64HKQiPgMuygfQR8beVD AiNkLhE1Q8KU02aK5fx66j8k0Bfxwhr5lnOXbsyLVnJ62Xx5U6vP1wVkzBDacITgQh/Q ARPxTxGevjI3ZUwjq+1n2k7X9tHfUYyfgOMjqP6GKuXrdfScaH4a7XU7zDBi+d1sYWgK DQ0VDHuRVMdVHH6yvkJZz5wpZn3EtKURaG0WLUjskt+HwAoYYgbRkzeqIHJ2JNkefO9z TpdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:thread-index:content-language :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=AyLmLCuRVd0Wy3I91kVpmQuMYyO5y2KBj4a/lzSLwjQ=; fh=ZObKuiLHqS0qoMMC1BEEzNyeT+IyeAqVtRTZKxBpTfQ=; b=B8wGzYYcQqCGFnMdmia07hTvSV2+raPkdJiNB5ddIUI5Fch7uHPtKgczdHfGMQGNT8 HfO690DDf2C18KNT7uo3HJPMXnH1YOKEyo91YHHTd/kke7UDgebVyJLo88nsrGmNNjzA RGb3/H4HvkECN/2m9UAQqCl4NGVI8SVCOQmwrilNpWfrTytgC33E0OH2r2GtYGXGPyOt XSIPANu/V+m0POPApVoG3Eia+PfnaV1YLzcVPT4J6HZypbVcy9mbMP5sOj0Y0h3k7p9f /+ttJ5AXRqXvqiUoD39QoMDtbTW8WZ97TqET56kh7DPjSxY1ooyc+H8sWycr/xe5kNZM uCZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nextmovesoftware.com header.s=default header.b=ArTdl1vT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o7-20020a056402038700b005378c7bca5asi75854edv.142.2023.10.04.15.20.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 15:20:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=fail header.i=@nextmovesoftware.com header.s=default header.b=ArTdl1vT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D096385AC3A for ; Wed, 4 Oct 2023 22:20:04 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778865154578072467 X-GMAIL-MSGID: 1778865154578072467 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; };