diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-04-27 14:22:48 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-04-27 14:22:48 +0000 |
commit | d1754765662030774356b272c3c818cac6aa11dd (patch) | |
tree | a4b29d82065a290b09fc5215e55fb810f79e2498 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 9a485985cd2817d21c8a996a1d973411aab55ab9 (diff) | |
download | bcm5719-llvm-d1754765662030774356b272c3c818cac6aa11dd.tar.gz bcm5719-llvm-d1754765662030774356b272c3c818cac6aa11dd.zip |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index f2f22ee2c39..9ef4ad77558 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -699,6 +699,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.Reciprocals = Args.getAllArgValues(OPT_mrecip_EQ); Opts.ReciprocalMath = Args.hasArg(OPT_freciprocal_math); Opts.NoTrappingMath = Args.hasArg(OPT_fno_trapping_math); + Opts.FPCastOverflowWorkaround = Args.hasArg(OPT_ffp_cast_overflow_workaround); + Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss); Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags); Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack); |