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

Rainer Orth via flang-commits flang-commits at lists.llvm.org
Wed Dec 6 05:49:23 PST 2023


https://github.com/rorth created https://github.com/llvm/llvm-project/pull/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 adjusting `_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT` accordingly.

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

>From 8a2b40ae63b19d085d3c12f82059a7f0bcc0f128 Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro at gcc.gnu.org>
Date: Wed, 6 Dec 2023 14:46:21 +0100
Subject: [PATCH] [flang] Adjust _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT for
 Solaris

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`.
---
 flang/include/flang/Runtime/magic-numbers.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the flang-commits mailing list