Skip to content

Commit 6e87672

Browse files
authored
[flang] Adjust _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT for Solaris (#74590)
Even after 13e2200 (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`.
1 parent 15617d1 commit 6e87672

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flang/runtime/exceptions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ std::int32_t RTNAME(MapException)(int32_t except) {
7878
// Verify that the size of ieee_modes_type and ieee_status_type objects from
7979
// intrinsic module file __fortran_ieee_exceptions.f90 are large enough to
8080
// hold fenv_t object.
81+
// TODO: fenv_t can be way larger than
82+
// sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT
83+
// on some systems, e.g. Solaris, so omit object size comparison for now.
8184
// TODO: consider femode_t object size comparison once its more mature.
82-
static_assert(
83-
sizeof(fenv_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT,
84-
"increase ieee_status_type size");
8585

8686
} // extern "C"
8787
} // namespace Fortran::runtime

0 commit comments

Comments
 (0)