Skip to content

Commit d96c5ee

Browse files
Address review comments.
1 parent 971cc61 commit d96c5ee

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ Non-comprehensive list of changes in this release
208208
like ``typeof_unqual`` from C23, similar to ``__typeof__`` and ``typeof``.
209209

210210

211-
* Code compiled with ``-shared`` and ``-ffast-math`` will no longer enable
212-
flush-to-zero floating-point mode by default. This decision can be overridden
213-
with use of ``-mdaz-ftz``. This behavior now matches GCC's behavior.
211+
* Shared libraries linked with either the ``-ffast-math``, ``-Ofast``, or
212+
``-funsafe-math-optimizations`` flags will no longer enable flush-to-zero
213+
floating-point mode by default. This decision can be overridden with use of
214+
``-mdaz-ftz``. This behavior now matches GCC's behavior.
214215
(`#57589 <https://github.com/llvm/llvm-project/issues/57589>`_)
215216

216217
New Compiler Flags

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,7 @@ defm protect_parens : BoolFOption<"protect-parens",
26182618
defm daz_ftz : SimpleMFlag<"daz-ftz",
26192619
"Globally set", "Do not globally set",
26202620
" the denormals-are-zero (DAZ) and flush-to-zero (FTZ) bits in the "
2621-
"floating-point control register on program startup.">;
2621+
"floating-point control register on program startup">;
26222622

26232623
def ffor_scope : Flag<["-"], "ffor-scope">, Group<f_Group>;
26242624
def fno_for_scope : Flag<["-"], "fno-for-scope">, Group<f_Group>;

clang/test/Driver/linux-ld.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,36 +1448,28 @@
14481448
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
14491449
// Don't link crtfastmath.o with -shared
14501450
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared \
1451-
// RUN: --gcc-toolchain="" \
14521451
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14531452
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
14541453
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -Ofast -shared \
1455-
// RUN: --gcc-toolchain="" \
14561454
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14571455
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
14581456
// Check for effects of -mdaz-ftz
1459-
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared -mdaz-ftz \
1460-
// RUN: --gcc-toolchain="" \
1457+
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -shared -mdaz-ftz \
14611458
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14621459
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
14631460
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -mdaz-ftz \
1464-
// RUN: --gcc-toolchain="" \
14651461
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14661462
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
14671463
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -mdaz-ftz \
1468-
// RUN: --gcc-toolchain="" \
14691464
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14701465
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1471-
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared -mno-daz-ftz \
1472-
// RUN: --gcc-toolchain="" \
1466+
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -shared -mno-daz-ftz \
14731467
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14741468
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
14751469
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -mno-daz-ftz \
1476-
// RUN: --gcc-toolchain="" \
14771470
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14781471
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
14791472
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -mno-daz-ftz \
1480-
// RUN: --gcc-toolchain="" \
14811473
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
14821474
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
14831475
// CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtfastmath.o

0 commit comments

Comments
 (0)