[flang-commits] [flang] [flang] Modifications to ieee_support_halting (PR #120747)

via flang-commits flang-commits at lists.llvm.org
Fri Dec 20 10:18:29 PST 2024


vdonaldson wrote:

I've updated the `SupportHalting` code in file `exceptions.cpp` as below to return `no support` on windows, which should be conservatively correct. If the windows build still fails, or there is a better way to address this issue for windows, please comment. Especially if a simple `#include` or some such will suffice.
```
diff --git a/flang/runtime/exceptions.cpp b/flang/runtime/exceptions.cpp
index 76f8d5168d7b..b34fcfef2b04 100644
--- a/flang/runtime/exceptions.cpp
+++ b/flang/runtime/exceptions.cpp
@@ -84,6 +84,8 @@ uint32_t RTNAME(MapException)(uint32_t excepts) {
 // Check if the processor has the ability to control whether to halt or
 // continue execution when a given exception is raised.
 bool RTNAME(SupportHalting)(uint32_t except) {
+  bool result = false;
+#ifndef _WIN32
   except = RTNAME(MapException)(except);
   int currentSet = fegetexcept(), flipSet, ok;
   if (currentSet & except) {
@@ -95,7 +97,9 @@ bool RTNAME(SupportHalting)(uint32_t except) {
     flipSet = fegetexcept();
     ok |= fedisableexcept(except);
   }
-  return ok != -1 && currentSet != flipSet;
+  result = ok != -1 && currentSet != flipSet;
+#endif
+  return result;
 }
```

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


More information about the flang-commits mailing list