From patchwork Fri Sep 30 07:20:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp354121wrs; Fri, 30 Sep 2022 00:21:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4o7Ft+k+OuVw3ROMVuBZ+3bzNd86MmsWqyxu7VT05Xz8MgMYB6li3AHbXDb22QjV7TRGol X-Received: by 2002:a05:6402:40d1:b0:44f:e974:f981 with SMTP id z17-20020a05640240d100b0044fe974f981mr7016985edb.222.1664522488050; Fri, 30 Sep 2022 00:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664522488; cv=none; d=google.com; s=arc-20160816; b=uq5rSpwcfRzzMu93PQ2uvUHwsqVmI00rzYHcZnpesNzVGkR5/rQtYW9A1ongV+SIjB ytwG9sN6vgIzjnRU3iYgzfBHclOL+/IXsRhHUfg2tQI4SQryO0NnanHbinSzeNmk6jtC MrbMBtkhWYHyFj8pZ/8CgVGY7YZIBc7/6PBDWEft+TFIDT2Fa/6VTAU3usuMfO+pNwRB b7fEeSzHg4hFA/A38Mt1x9tqV8rorzea044EBeO2Hec/9jyrXzhCf6FcTbR4LyZUCihz JaowUb75ovLXz+KksrAlGSxgHH8brlp6ddhVJF4n5a2hqdT/hzp2QuANdKpBXAnuzReW JXWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:in-reply-to:mime-version:references:message-id :subject:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=vB9cbEsKQ25a/hiL00jxtGHQHIAEcfrPrKpLuqSqTB0=; b=QzNrQfGW85mKnGhAITwM5FLMY619Zo6WeK82Dt09DA0LSS76U9rpM7km1O1YCXhMMB EGGDCxj9zbZcK9z/RWDC9vww9bmr88Q9MAUAd8EP8NETt20yX6kUhNjUoOP0ILqZ6o+E dVYpwnBwtxSPAW8XbM5gisfNd1GTT6aY2JbxnUUpcDmEa0alQluDlIEDW2mFa/XqSYe4 nDF5/0vBLyeNk803jvg2C4xDd14WF5D9IgkyyH1B9lwhMsl3MEYb51oPDLFJdp3xZ1w5 /eVsAAlrM96pUdj8vCX3L8iYWpqmc1Dd7g3zydW5anPZKFyC+IElAXQqOYzmNgY1nD1K jDQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pfNXTdkI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id he16-20020a1709073d9000b00782e27026c7si1634997ejc.17.2022.09.30.00.21.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 00:21:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pfNXTdkI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D0A4C3854151 for ; Fri, 30 Sep 2022 07:21:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0A4C3854151 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664522486; bh=vB9cbEsKQ25a/hiL00jxtGHQHIAEcfrPrKpLuqSqTB0=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pfNXTdkICZdJBRgk//Qu5BKTCbREh++XshodqT2PByvBJ1aqt+4r4naY/wMU0dZ1A Bn29/6o2eFWB/g91p8JTbFC2ncHa2ehX69NIRaIZ1dubIA8jAiGgaR4M8QL5k4+Oo0 ThLDHUfjGcR08aRtEAy6SQlDJoQfJt159SBePSSE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5BD90385C332 for ; Fri, 30 Sep 2022 07:20:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5BD90385C332 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-412-10fIvJFUPLW0av35sPQBuw-1; Fri, 30 Sep 2022 03:20:35 -0400 X-MC-Unique: 10fIvJFUPLW0av35sPQBuw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E49A80206D; Fri, 30 Sep 2022 07:20:35 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 217F32166B26; Fri, 30 Sep 2022 07:20:34 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 28U7KWBK3857143 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 30 Sep 2022 09:20:32 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28U7KVoh3857142; Fri, 30 Sep 2022 09:20:31 +0200 Date: Fri, 30 Sep 2022 09:20:30 +0200 To: Joseph Myers , Bruce Korb , Jason Merrill , gcc-patches@gcc.gnu.org Subject: [PATCH] fixincludes: Deal also with the _Float128x cases [PR107059] Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745378332542535276?= X-GMAIL-MSGID: =?utf-8?q?1745378332542535276?= On Wed, Sep 28, 2022 at 08:19:43PM +0200, Jakub Jelinek via Gcc-patches wrote: > Another case are the following 3 snippets: > # if !__GNUC_PREREQ (7, 0) || defined __cplusplus > # error "_Float128X supported but no constant suffix" > # else > # define __f128x(x) x##f128x > # endif > ... > # if !__GNUC_PREREQ (7, 0) || defined __cplusplus > # error "_Float128X supported but no complex type" > # else > # define __CFLOAT128X _Complex _Float128x > # endif > ... > # if !__GNUC_PREREQ (7, 0) || defined __cplusplus > # error "_Float128x supported but no type" > # endif > but as no target has _Float128x right now and don't see it > coming soon, it isn't a big deal (on the glibc side it is of > course ok to adjust those). This incremental patch deals handles the above 3 cases, so we fixinclude what glibc itself changed too. Bootstrapped/regtested on x86_64-linux and i686-linux (together with the previously posted fixincludes/ change too), ok for trunk? 2022-09-30 Jakub Jelinek PR bootstrap/107059 * inclhack.def (glibc_cxx_floatn_5): New. * fixincl.x: Regenerated. * tests/base/bits/floatn.h: Regenerated. Jakub --- fixincludes/inclhack.def.jj 2022-09-29 22:18:47.974402688 +0200 +++ fixincludes/inclhack.def 2022-09-29 22:22:48.151145670 +0200 @@ -2131,6 +2131,23 @@ fix = { EOT; }; +fix = { + hackname = glibc_cxx_floatn_5; + files = bits/floatn.h, bits/floatn-common.h, "*/bits/floatn.h", "*/bits/floatn-common.h"; + select = "^([ \t]*#[ \t]*if !__GNUC_PREREQ \\(7, 0\\) \\|\\| )defined __cplusplus\n" + "([ \t]*#[ \t]+error \"_Float128[xX] supported but no )"; + c_fix = format; + c_fix_arg = "%1(defined __cplusplus && !__GNUC_PREREQ (13, 0))\n%2"; + test_text = <<-EOT + # if !__GNUC_PREREQ (7, 0) || defined __cplusplus + # error "_Float128X supported but no constant suffix" + # endif + # if !__GNUC_PREREQ (7, 0) || defined __cplusplus + # error "_Float128x supported but no type" + # endif + EOT; +}; + /* glibc-2.3.5 defines pthread mutex initializers incorrectly, * so we replace them with versions that correspond to the * definition. --- fixincludes/fixincl.x.jj 2022-09-29 22:18:47.975402675 +0200 +++ fixincludes/fixincl.x 2022-09-29 22:22:55.675909244 +0200 @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed September 28, 2022 at 07:56:15 PM by AutoGen 5.18.16 + * It has been AutoGen-ed September 29, 2022 at 10:22:55 PM by AutoGen 5.18.16 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Sep 28 19:56:15 CEST 2022 +/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Sep 29 22:22:55 CEST 2022 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 271 fixup descriptions. + * This file contains 272 fixup descriptions. * * See README for more information. * @@ -4273,6 +4273,43 @@ static const char* apzGlibc_Cxx_Floatn_4 /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Glibc_Cxx_Floatn_5 fix + */ +tSCC zGlibc_Cxx_Floatn_5Name[] = + "glibc_cxx_floatn_5"; + +/* + * File name selection pattern + */ +tSCC zGlibc_Cxx_Floatn_5List[] = + "bits/floatn.h\0bits/floatn-common.h\0*/bits/floatn.h\0*/bits/floatn-common.h\0"; +/* + * Machine/OS name selection pattern + */ +#define apzGlibc_Cxx_Floatn_5Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zGlibc_Cxx_Floatn_5Select0[] = + "^([ \t]*#[ \t]*if !__GNUC_PREREQ \\(7, 0\\) \\|\\| )defined __cplusplus\n\ +([ \t]*#[ \t]+error \"_Float128[xX] supported but no )"; + +#define GLIBC_CXX_FLOATN_5_TEST_CT 1 +static tTestDesc aGlibc_Cxx_Floatn_5Tests[] = { + { TT_EGREP, zGlibc_Cxx_Floatn_5Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Glibc_Cxx_Floatn_5 + */ +static const char* apzGlibc_Cxx_Floatn_5Patch[] = { + "format", + "%1(defined __cplusplus && !__GNUC_PREREQ (13, 0))\n\ +%2", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Glibc_Mutex_Init fix */ tSCC zGlibc_Mutex_InitName[] = @@ -11038,9 +11075,9 @@ static const char* apzX11_SprintfPatch[] * * List of all fixes */ -#define REGEX_COUNT 309 +#define REGEX_COUNT 310 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 271 +#define FIX_COUNT 272 /* * Enumerate the fixes @@ -11147,6 +11184,7 @@ typedef enum { GLIBC_CXX_FLOATN_2_FIXIDX, GLIBC_CXX_FLOATN_3_FIXIDX, GLIBC_CXX_FLOATN_4_FIXIDX, + GLIBC_CXX_FLOATN_5_FIXIDX, GLIBC_MUTEX_INIT_FIXIDX, GLIBC_STDINT_FIXIDX, GLIBC_STRNCPY_FIXIDX, @@ -11825,6 +11863,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { GLIBC_CXX_FLOATN_4_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aGlibc_Cxx_Floatn_4Tests, apzGlibc_Cxx_Floatn_4Patch, 0 }, + { zGlibc_Cxx_Floatn_5Name, zGlibc_Cxx_Floatn_5List, + apzGlibc_Cxx_Floatn_5Machs, + GLIBC_CXX_FLOATN_5_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aGlibc_Cxx_Floatn_5Tests, apzGlibc_Cxx_Floatn_5Patch, 0 }, + { zGlibc_Mutex_InitName, zGlibc_Mutex_InitList, apzGlibc_Mutex_InitMachs, GLIBC_MUTEX_INIT_TEST_CT, FD_MACH_ONLY, --- fixincludes/tests/base/bits/floatn.h.jj 2022-09-29 22:18:47.976402661 +0200 +++ fixincludes/tests/base/bits/floatn.h 2022-09-29 22:23:19.703717787 +0200 @@ -84,3 +84,13 @@ typedef long double _Float128; # define __CFLOAT128 _Complex long double # endif #endif /* GLIBC_CXX_FLOATN_4_CHECK */ + + +#if defined( GLIBC_CXX_FLOATN_5_CHECK ) +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +# error "_Float128X supported but no constant suffix" +# endif +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +# error "_Float128x supported but no type" +# endif +#endif /* GLIBC_CXX_FLOATN_5_CHECK */