From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 0544A3856DD3; Fri, 7 Oct 2022 07:00:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0544A3856DD3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665126026; bh=OCjcg866oOfvaSfKFzX0yjskakBAF1OflGKsS+P4ESw=; h=From:To:Subject:Date:From; b=Ydnr1LuqW+yAEYcnoQBL6WKkLLhH43XiJWw2wnkeRMsDKCBN4b/s0tVEfDFfcplUf v0sK8/FRAKht9szZATnPXlhbPQ5dgsFh+ucRm3j18DNifKq3vA3nUgXGjWvMV8rRgO r2QqDO5P5RzghaZuCmTUNCin/iSgmkCdBXdGxojw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3148] fixincludes: Deal also with the _Float128x cases [PR107059] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: 62ec780ac0b4d109f2a3c8c4597cb19a82f6188d X-Git-Newrev: 348e46fa8cba960c23170673bfc0c1b4fb384975 Message-Id: <20221007070026.0544A3856DD3@sourceware.org> Date: Fri, 7 Oct 2022 07:00:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:348e46fa8cba960c23170673bfc0c1b4fb384975 commit r13-3148-g348e46fa8cba960c23170673bfc0c1b4fb384975 Author: Jakub Jelinek Date: Fri Oct 7 08:59:05 2022 +0200 fixincludes: Deal also with the _Float128x cases [PR107059] 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. 2022-10-07 Jakub Jelinek PR bootstrap/107059 * inclhack.def (glibc_cxx_floatn_5): New. * fixincl.x: Regenerated. * tests/base/bits/floatn.h: Regenerated. Diff: --- fixincludes/fixincl.x | 53 ++++++++++++++++++++++++++++++++---- fixincludes/inclhack.def | 17 ++++++++++++ fixincludes/tests/base/bits/floatn.h | 10 +++++++ 3 files changed, 75 insertions(+), 5 deletions(-) diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index ff3c724c850..20867548e24 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -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. * @@ -4271,6 +4271,43 @@ static const char* apzGlibc_Cxx_Floatn_4Patch[] = { %2", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * 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 @@ -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, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 71f1c47c07f..d4637470d7a 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -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. diff --git a/fixincludes/tests/base/bits/floatn.h b/fixincludes/tests/base/bits/floatn.h index c80941f5666..9681134a5f3 100644 --- a/fixincludes/tests/base/bits/floatn.h +++ b/fixincludes/tests/base/bits/floatn.h @@ -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 */