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

via flang-commits flang-commits at lists.llvm.org
Thu Dec 14 13:03:50 PST 2023


Author: Rainer Orth
Date: 2023-12-14T22:03:45+01:00
New Revision: 6e87672150986d931e770ec829699a7930ebeeb2

URL: https://github.com/llvm/llvm-project/commit/6e87672150986d931e770ec829699a7930ebeeb2
DIFF: https://github.com/llvm/llvm-project/commit/6e87672150986d931e770ec829699a7930ebeeb2.diff

LOG: [flang] Adjust _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT for Solaris (#74590)

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 removing the assertion.

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

Added: 
    

Modified: 
    flang/runtime/exceptions.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/exceptions.cpp b/flang/runtime/exceptions.cpp
index 1dbee833884fbc..dfd3b812e22a13 100644
--- a/flang/runtime/exceptions.cpp
+++ b/flang/runtime/exceptions.cpp
@@ -78,10 +78,10 @@ std::int32_t RTNAME(MapException)(int32_t except) {
 // Verify that the size of ieee_modes_type and ieee_status_type objects from
 // intrinsic module file __fortran_ieee_exceptions.f90 are large enough to
 // hold fenv_t object.
+// TODO: fenv_t can be way larger than
+//	sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT
+// on some systems, e.g. Solaris, so omit object size comparison for now.
 // TODO: consider femode_t object size comparison once its more mature.
-static_assert(
-    sizeof(fenv_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT,
-    "increase ieee_status_type size");
 
 } // extern "C"
 } // namespace Fortran::runtime


        


More information about the flang-commits mailing list