From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 954473849ADB; Wed, 24 Apr 2024 18:36:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 954473849ADB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713983809; bh=nTEOPSdesOCiMK8Y/SpdW1g8AVfEqFlD+OAnjXRK8mQ=; h=From:To:Subject:Date:From; b=o8Cc4Xfxg8b08a75DbC7P0hOo3HlhwFsBzg53H9dejMHJzx0fS6P8SYmdYD0yVuPX sBrcbjiHL8FpcSUbLfaSt8MZW8It5jvH++eppWMUUFxYXXi706YjwE9+Ul+WOYxw89 jhkBuoiXQtqXZ7FS4PcZpNiaWHLzWxZYxRZP0I74= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11354] Fixincludes: Handle __FLT_EVAL_METHOD__ == 16 on darwin X-Act-Checkin: gcc X-Git-Author: Francois-Xavier Coudert X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 3bb14f6ed5bc70e25381c67963c90eaab91eca22 X-Git-Newrev: a58d68924cadd62021e248bf2c6f5af638f7e0f1 Message-Id: <20240424183649.954473849ADB@sourceware.org> Date: Wed, 24 Apr 2024 18:36:49 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a58d68924cadd62021e248bf2c6f5af638f7e0f1 commit r11-11354-ga58d68924cadd62021e248bf2c6f5af638f7e0f1 Author: Francois-Xavier Coudert Date: Sat Jan 1 12:22:00 2022 +0100 Fixincludes: Handle __FLT_EVAL_METHOD__ == 16 on darwin The darwin system headers error out on __FLT_EVAL_METHOD__ == 16, which occurs when the compiler is called with -mavx512fp16 on i386. Allow this value to proceed past the check (nothing else depends on it in the system headers). fixincludes/ChangeLog: * inclhack.def: Add new fix on darwin. * fixincl.x: Regenerate. * tests/base/math.h: Regenerate. (cherry picked from commit 4f3b1a09d3109f03299a2ac15cfa3059596fcb1d) Diff: --- fixincludes/fixincl.x | 53 +++++++++++++++++++++++++++++++++++++++---- fixincludes/inclhack.def | 11 +++++++++ fixincludes/tests/base/math.h | 5 ++++ 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 57bc3fa5489..442de9226b5 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 May 15, 2023 at 11:55:05 PM by AutoGen 5.18.7 + * It has been AutoGen-ed April 12, 2024 at 12:46:40 PM by AutoGen 5.18.7 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Mon May 15 23:55:05 BST 2023 +/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Apr 12 12:46:40 BST 2024 * * 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 262 fixup descriptions. + * This file contains 263 fixup descriptions. * * See README for more information. * @@ -3651,6 +3651,43 @@ static const char* apzDarwin_Ucred__AtomicPatch[] = { #endif\n", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Darwin_Flt_Eval_Method fix + */ +tSCC zDarwin_Flt_Eval_MethodName[] = + "darwin_flt_eval_method"; + +/* + * File name selection pattern + */ +tSCC zDarwin_Flt_Eval_MethodList[] = + "math.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzDarwin_Flt_Eval_MethodMachs[] = { + "*-*-darwin*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zDarwin_Flt_Eval_MethodSelect0[] = + "^#if __FLT_EVAL_METHOD__ == 0$"; + +#define DARWIN_FLT_EVAL_METHOD_TEST_CT 1 +static tTestDesc aDarwin_Flt_Eval_MethodTests[] = { + { TT_EGREP, zDarwin_Flt_Eval_MethodSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Darwin_Flt_Eval_Method + */ +static const char* apzDarwin_Flt_Eval_MethodPatch[] = { + "format", + "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Dec_Intern_Asm fix @@ -10647,9 +10684,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 300 +#define REGEX_COUNT 301 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 262 +#define FIX_COUNT 263 /* * Enumerate the fixes @@ -10741,6 +10778,7 @@ typedef enum { DARWIN_STDINT_6_FIXIDX, DARWIN_STDINT_7_FIXIDX, DARWIN_UCRED__ATOMIC_FIXIDX, + DARWIN_FLT_EVAL_METHOD_FIXIDX, DEC_INTERN_ASM_FIXIDX, DJGPP_WCHAR_H_FIXIDX, ECD_CURSOR_FIXIDX, @@ -11350,6 +11388,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { DARWIN_UCRED__ATOMIC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aDarwin_Ucred__AtomicTests, apzDarwin_Ucred__AtomicPatch, 0 }, + { zDarwin_Flt_Eval_MethodName, zDarwin_Flt_Eval_MethodList, + apzDarwin_Flt_Eval_MethodMachs, + DARWIN_FLT_EVAL_METHOD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aDarwin_Flt_Eval_MethodTests, apzDarwin_Flt_Eval_MethodPatch, 0 }, + { zDec_Intern_AsmName, zDec_Intern_AsmList, apzDec_Intern_AsmMachs, DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index c2f54d1189a..6478ca19932 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1814,6 +1814,17 @@ fix = { test_text = ""; /* Don't provide this for wrap fixes. */ }; +/* The darwin headers don't accept __FLT_EVAL_METHOD__ == 16. */ +fix = { + hackname = darwin_flt_eval_method; + mach = "*-*-darwin*"; + files = math.h; + select = "^#if __FLT_EVAL_METHOD__ == 0$"; + c_fix = format; + c_fix_arg = "#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16"; + test_text = "#if __FLT_EVAL_METHOD__ == 0"; +}; + /* * Fix on Digital UNIX V4.0: * It contains a prototype for a DEC C internal asm() function, diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h index c7da15ad2c7..58f695f9adf 100644 --- a/fixincludes/tests/base/math.h +++ b/fixincludes/tests/base/math.h @@ -30,6 +30,11 @@ #endif /* DARWIN_9_LONG_DOUBLE_FUNCS_2_CHECK */ +#if defined( DARWIN_FLT_EVAL_METHOD_CHECK ) +#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16 +#endif /* DARWIN_FLT_EVAL_METHOD_CHECK */ + + #if defined( HPPA_HPUX_FP_MACROS_CHECK ) #endif /* _INCLUDE_HPUX_SOURCE */