From 109aa3d265b18cffd00a4576a8ab8f52f80bc752 Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Fri, 13 Mar 2026 19:14:02 +0100 Subject: [PATCH] apply workaround for clang bug more broadly Xcode 26 distributes a clang version which identifies itself with __clang_major__=17 and that is also affected by the bug for which the workaround in commit 2fbdd292af3f47a66265384a7cc71d2fd891989b was added. Closes #825. --- src/c/stacks.d | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/c/stacks.d b/src/c/stacks.d index d22a4f267..ef52372c6 100644 --- a/src/c/stacks.d +++ b/src/c/stacks.d @@ -279,9 +279,9 @@ ecl_stack_frame_open(cl_env_ptr env, cl_object f, cl_index size) return f; } -/* clang 19 miscompiles the following function on x86_64. Temporarily - * turn off optimizations here. */ -#if defined(__clang__) && __clang_major__ == 19 && defined(__x86_64__) +/* Some clang versions miscompile the following function on x86_64. + * Temporarily turn off optimizations here. */ +#if defined(__clang__) && __clang_major__ >= 17 && __clang_major__ <= 19 && defined(__x86_64__) [[clang::optnone]] #endif void @@ -339,9 +339,9 @@ ecl_stack_frame_push_values(cl_object f) } } -/* clang 19 miscompiles the following function on x86_64. Temporarily - * turn off optimizations here. */ -#if defined(__clang__) && __clang_major__ == 19 && defined(__x86_64__) +/* Some clang versions miscompile the following function on x86_64. + * Temporarily turn off optimizations here. */ +#if defined(__clang__) && __clang_major__ >= 17 && __clang_major__ <= 19 && defined(__x86_64__) [[clang::optnone]] #endif cl_object