[all-commits] [llvm/llvm-project] 8c7f2a: [CodeGen] use saturating FP casts when compiling w...
RotateRight via All-commits
all-commits at lists.llvm.org
Thu Dec 16 06:26:29 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8c7f2a4f871928d8734ee3f03e67d09086850b60
https://github.com/llvm/llvm-project/commit/8c7f2a4f871928d8734ee3f03e67d09086850b60
Author: Sanjay Patel <spatel at rotateright.com>
Date: 2021-12-16 (Thu, 16 Dec 2021)
Changed paths:
M clang/lib/CodeGen/CGExprScalar.cpp
M clang/test/CodeGen/no-junk-ftrunc.c
Log Message:
-----------
[CodeGen] use saturating FP casts when compiling with "no-strict-float-cast-overflow"
We got an unintended consequence of the optimizer getting smarter when
compiling in a non-standard mode, and there's no good way to inhibit
those optimizations at a later stage. The test is based on an example
linked from D92270.
We allow the "no-strict-float-cast-overflow" exception to normal C
cast rules to preserve legacy code that does not expect overflowing
casts from FP to int to produce UB. See D46236 for details.
Differential Revision: https://reviews.llvm.org/D115804
More information about the All-commits
mailing list