[clang] Fix math-errno issue (PR #66381)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 12:29:41 PDT 2023


================
@@ -2339,6 +2345,28 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
   // LLVM counterparts if the call is marked 'const' (known to never set errno).
   // In case FP exceptions are enabled, the experimental versions of the
   // intrinsics model those.
+  bool ConstAlways =
+      getContext().BuiltinInfo.isConst(BuiltinID);
+
+  // There's a special case with the fma builtins where they are always const
+  // if the target environment is GNU or the target is OS is Windows and we're
+  // targeting the MSVCRT.dll environment.
+  switch (BuiltinID) {
----------------
zahiraam wrote:

hmm! First quick response would be, not sure where to get that from? But I will look at it longer to see if there is a way. @andykaylor WDYT?

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


More information about the cfe-commits mailing list