[clang] [clang] Set FPOptions at the beginning of CompoundStmt (PR #111654)

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 11 07:46:16 PST 2024


================
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -emit-llvm -O2 -o - %s | FileCheck %s
----------------
spavloff wrote:

Yes, this fact is reflected in #84648. Actually the problem is incorrect optimization caused by wrong fast-math flags.

Also your example cannot demonstrate the issue because it is C++ code. In C++ mode instructions like SelectInst or PHINode do not get fast-math flags.

https://github.com/llvm/llvm-project/pull/111654


More information about the cfe-commits mailing list