Skip to content

Commit 2ec1052

Browse files
Address review comments.
1 parent fc0507f commit 2ec1052

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
@@ -145,9 +145,10 @@ Non-comprehensive list of changes in this release
145145
- ``__builtin_addc``, ``__builtin_subc``, and the other sizes of those
146146
builtins are now constexpr and may be used in constant expressions.
147147

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

153154
New Compiler Flags

clang/include/clang/Driver/Options.td

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

25892589
def ffor_scope : Flag<["-"], "ffor-scope">, Group<f_Group>;
25902590
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
@@ -1571,36 +1571,28 @@
15711571
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
15721572
// Don't link crtfastmath.o with -shared
15731573
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared \
1574-
// RUN: --gcc-toolchain="" \
15751574
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
15761575
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
15771576
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -Ofast -shared \
1578-
// RUN: --gcc-toolchain="" \
15791577
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
15801578
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
15811579
// Check for effects of -mdaz-ftz
1582-
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared -mdaz-ftz \
1583-
// RUN: --gcc-toolchain="" \
1580+
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -shared -mdaz-ftz \
15841581
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
15851582
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
15861583
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -mdaz-ftz \
1587-
// RUN: --gcc-toolchain="" \
15881584
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
15891585
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
15901586
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -mdaz-ftz \
1591-
// RUN: --gcc-toolchain="" \
15921587
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
15931588
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1594-
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared -mno-daz-ftz \
1595-
// RUN: --gcc-toolchain="" \
1589+
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -shared -mno-daz-ftz \
15961590
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
15971591
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
15981592
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -mno-daz-ftz \
1599-
// RUN: --gcc-toolchain="" \
16001593
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
16011594
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
16021595
// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -mno-daz-ftz \
1603-
// RUN: --gcc-toolchain="" \
16041596
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
16051597
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
16061598
// CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtfastmath.o

0 commit comments

Comments
 (0)