[flang-commits] [flang] [flang] Adjust _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT for Solaris (PR #74590)

via flang-commits flang-commits at lists.llvm.org
Wed Dec 6 05:50:36 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-runtime

Author: Rainer Orth (rorth)

<details>
<summary>Changes</summary>

Even after 13e2200fa426faffb62bdaf8b2f1f5699eee1511 (Solaris lacks `femode_t`, too), the Solaris flang build is still broken:
```
/vol/llvm/src/llvm-project/local/flang/runtime/exceptions.cpp:87:5: error: static assertion failed due to requirement 'sizeof(fenv_t) <= sizeof(int) * 8': increase ieee_status_type size
   87 |     sizeof(fenv_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT,      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/vol/llvm/src/llvm-project/local/flang/runtime/exceptions.cpp:87:20: note: expression evaluates to '200 <= 32'
   87 |     sizeof(fenv_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT,      |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This patch fixes this by adjusting `_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT` accordingly.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

---
Full diff: https://github.com/llvm/llvm-project/pull/74590.diff


1 Files Affected:

- (modified) flang/include/flang/Runtime/magic-numbers.h (+1-1) 


``````````diff
diff --git a/flang/include/flang/Runtime/magic-numbers.h b/flang/include/flang/Runtime/magic-numbers.h
index d00d5027d4ed2..cebf9f3a65478 100644
--- a/flang/include/flang/Runtime/magic-numbers.h
+++ b/flang/include/flang/Runtime/magic-numbers.h
@@ -107,6 +107,6 @@ as int arrays with the following extents to allow build time validation of
 these sizes in cross compilation environments.
 #endif
 #define _FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT 2
-#define _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT 8
+#define _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT 50
 
 #endif

``````````

</details>


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


More information about the flang-commits mailing list