[clang] [lld] [libcxx] [clang-tools-extra] [flang] [compiler-rt] [libc] [libcxxabi] [libunwind] [lldb] [llvm] Fix a bug in Smith's algorithm used in complex div/mul. (PR #78330)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 07:45:19 PST 2024


================
@@ -978,7 +978,11 @@ ComplexPairTy ComplexExprEmitter::EmitBinDiv(const BinOpInfo &Op) {
       return EmitRangeReductionDiv(LHSr, LHSi, RHSr, RHSi);
     else if (Op.FPFeatures.getComplexRange() == LangOptions::CX_Limited)
       return EmitAlgebraicDiv(LHSr, LHSi, RHSr, RHSi);
-    else if (!CGF.getLangOpts().FastMath) {
+    else if (!CGF.getLangOpts().FastMath ||
+             // '-ffast-math' is used in the command line but followed by an
+             // '-fno-cx-limited-range'.
+             (CGF.getLangOpts().FastMath &&
+              Op.FPFeatures.getComplexRange() == LangOptions::CX_Full)) {
----------------
zahiraam wrote:

Done.

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


More information about the cfe-commits mailing list