public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-11354] Fixincludes: Handle __FLT_EVAL_METHOD__ == 16 on darwin
@ 2024-04-24 18:36 Iain D Sandoe
0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2024-04-24 18:36 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a58d68924cadd62021e248bf2c6f5af638f7e0f1
commit r11-11354-ga58d68924cadd62021e248bf2c6f5af638f7e0f1
Author: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
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 <c_asm.h> 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 */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-24 18:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24 18:36 [gcc r11-11354] Fixincludes: Handle __FLT_EVAL_METHOD__ == 16 on darwin Iain D Sandoe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).