[Driver, CodeGen] add options to enable/disable an FP cast optimization
authorSanjay Patel <spatel@rotateright.com>
Fri, 27 Apr 2018 14:22:48 +0000 (14:22 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 27 Apr 2018 14:22:48 +0000 (14:22 +0000)
commitd1754765662030774356b272c3c818cac6aa11dd
treea4b29d82065a290b09fc5215e55fb810f79e2498
parent9a485985cd2817d21c8a996a1d973411aab55ab9
[Driver, CodeGen] add options to enable/disable an FP cast optimization

As discussed in the post-commit thread for:
rL330437 ( http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180423/545906.html )

We need a way to opt-out of a float-to-int-to-float cast optimization because too much
existing code relies on the platform-specific undefined result of those casts when the
float-to-int overflows.

The LLVM changes associated with adding this function attribute are here:
rL330947
rL330950
rL330951

Also as suggested, I changed the LLVM doc to mention the specific sanitizer flag that
catches this problem:
rL330958

Differential Revision: https://reviews.llvm.org/D46135

llvm-svn: 331041
clang/docs/UsersManual.rst
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/CodeGen/CGCall.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/no-junk-ftrunc.c [new file with mode: 0644]
clang/test/Driver/fast-math.c