[flang-commits] [flang] aeb2cd3 - [flang] Keep PURE in IEEE functions

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Fri Jun 24 00:10:24 PDT 2022


Author: Valentin Clement
Date: 2022-06-24T09:10:18+02:00
New Revision: aeb2cd3176b03c3f186ca5d3ae6bd08d2ba77227

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

LOG: [flang] Keep PURE in IEEE functions

PURE keyword should be kept in `__fortran_ieee_exceptions.f90`
and `ieee_arithmetic.f90` and not removed as done in
https://reviews.llvm.org/D128431

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D128498

Added: 
    

Modified: 
    flang/module/__fortran_ieee_exceptions.f90
    flang/module/ieee_arithmetic.f90

Removed: 
    


################################################################################
diff  --git a/flang/module/__fortran_ieee_exceptions.f90 b/flang/module/__fortran_ieee_exceptions.f90
index 7232bbf53cd61..0b620f55cee84 100644
--- a/flang/module/__fortran_ieee_exceptions.f90
+++ b/flang/module/__fortran_ieee_exceptions.f90
@@ -124,13 +124,13 @@ end subroutine ieee_set_status
   end interface
 
 #define IEEE_SUPPORT_FLAG_R(XKIND) \
-  logical function ieee_support_flag_a##XKIND(flag, x); \
+  pure logical function ieee_support_flag_a##XKIND(flag, x); \
     import ieee_flag_type; \
     type(ieee_flag_type), intent(in) :: flag; \
     real(XKIND), intent(in) :: x(..); \
   end function ieee_support_flag_a##XKIND;
   interface ieee_support_flag
-    logical function ieee_support_flag(flag)
+    pure logical function ieee_support_flag(flag)
       import ieee_flag_type
       type(ieee_flag_type), intent(in) :: flag
     end function ieee_support_flag

diff  --git a/flang/module/ieee_arithmetic.f90 b/flang/module/ieee_arithmetic.f90
index b2ac217aa86ae..365f803aca71e 100644
--- a/flang/module/ieee_arithmetic.f90
+++ b/flang/module/ieee_arithmetic.f90
@@ -514,7 +514,7 @@ pure logical function ieee_support_rounding_a##XKIND(round_value, x); \
     real(XKIND), intent(in) :: x(..); \
   end function ieee_support_rounding_a##XKIND;
   interface ieee_support_rounding
-    logical function ieee_support_rounding(round_value)
+    pure logical function ieee_support_rounding(round_value)
       import ieee_round_type
       type(ieee_round_type), intent(in) :: round_value
     end function ieee_support_rounding


        


More information about the flang-commits mailing list