[flang-commits] [flang] 592c0fe - [flang] Tweak a SCALE/IEEE_SCALB folding overflow warning message (#114994)

via flang-commits flang-commits at lists.llvm.org
Tue Nov 5 10:43:45 PST 2024


Author: vdonaldson
Date: 2024-11-05T13:43:41-05:00
New Revision: 592c0fe55f6d9a811028b5f3507be91458ab2713

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

LOG: [flang] Tweak a SCALE/IEEE_SCALB folding overflow warning message (#114994)

Added: 
    

Modified: 
    flang/lib/Evaluate/fold-real.cpp
    flang/test/Evaluate/errors01.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Evaluate/fold-real.cpp b/flang/lib/Evaluate/fold-real.cpp
index ed7749e8803011..0b79a417942a45 100644
--- a/flang/lib/Evaluate/fold-real.cpp
+++ b/flang/lib/Evaluate/fold-real.cpp
@@ -432,7 +432,7 @@ Expr<Type<TypeCategory::Real, KIND>> FoldIntrinsicFunction(
                               common::UsageWarning::FoldingException)) {
                         context.messages().Say(
                             common::UsageWarning::FoldingException,
-                            "SCALE intrinsic folding overflow"_warn_en_US);
+                            "SCALE/IEEE_SCALB intrinsic folding overflow"_warn_en_US);
                       }
                       return result.value;
                     }));

diff  --git a/flang/test/Evaluate/errors01.f90 b/flang/test/Evaluate/errors01.f90
index 684f3fc34e6872..33bda3babf9004 100644
--- a/flang/test/Evaluate/errors01.f90
+++ b/flang/test/Evaluate/errors01.f90
@@ -168,10 +168,13 @@ subroutine s14(n)
     print *, ibits(0, 33, n)
   end
   subroutine warnings
+    use ieee_arithmetic, only: ieee_scalb
     real, parameter :: ok1 = scale(0.0, 99999) ! 0.0
     real, parameter :: ok2 = scale(1.0, -99999) ! 0.0
-    !CHECK: SCALE intrinsic folding overflow
+    !CHECK: SCALE/IEEE_SCALB intrinsic folding overflow
     real, parameter :: bad1 = scale(1.0, 99999)
+    !CHECK: SCALE/IEEE_SCALB intrinsic folding overflow
+    real, parameter :: bad1a = ieee_scalb(1.0, 99999)
     !CHECK: complex ABS intrinsic folding overflow
     real, parameter :: bad2 = abs(cmplx(huge(0.),huge(0.)))
     !CHECK: warning: DIM intrinsic folding overflow


        


More information about the flang-commits mailing list