[flang-commits] [flang] [Flang] remove assert using femode_t from AIX (PR #74500)

via flang-commits flang-commits at lists.llvm.org
Tue Dec 5 10:26:22 PST 2023


https://github.com/madanial0 updated https://github.com/llvm/llvm-project/pull/74500

>From f228e531429827f91a5107844ff7538d7510f498 Mon Sep 17 00:00:00 2001
From: Mark Danial <madanial at dixon.rtp.raleigh.ibm.com>
Date: Tue, 5 Dec 2023 12:27:46 -0500
Subject: [PATCH 1/2] [Flang] remove assert using femode_t from AIX

---
 flang/runtime/exceptions.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/runtime/exceptions.cpp b/flang/runtime/exceptions.cpp
index 797d0c87e601d..91084f230baa3 100644
--- a/flang/runtime/exceptions.cpp
+++ b/flang/runtime/exceptions.cpp
@@ -78,7 +78,7 @@ 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 femode_t and fenv_t objects, respectively.
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(_AIX)
 static_assert(
     sizeof(femode_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT,
     "increase ieee_modes_type size");

>From 674477a3cc9791d1b7acd90d00178056f2da3a0c Mon Sep 17 00:00:00 2001
From: Mark Danial <madanial at dixon.rtp.raleigh.ibm.com>
Date: Tue, 5 Dec 2023 13:25:40 -0500
Subject: [PATCH 2/2] remove femode_t assert

---
 flang/runtime/exceptions.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/flang/runtime/exceptions.cpp b/flang/runtime/exceptions.cpp
index 91084f230baa3..1dbee833884fb 100644
--- a/flang/runtime/exceptions.cpp
+++ b/flang/runtime/exceptions.cpp
@@ -77,12 +77,8 @@ 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 femode_t and fenv_t objects, respectively.
-#if !defined(_WIN32) && !defined(_AIX)
-static_assert(
-    sizeof(femode_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT,
-    "increase ieee_modes_type size");
-#endif
+// hold fenv_t object.
+// 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");



More information about the flang-commits mailing list