[flang] Don't force SET_EXPONENT(I=...) argument to integer(4)
authorPeter Klausler <pklausler@nvidia.com>
Tue, 4 Oct 2022 17:17:04 +0000 (10:17 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 6 Oct 2022 18:20:27 +0000 (11:20 -0700)
commit81003744374dd2a75ae8dd190cdf2188cc086820
tree68e15c5645a3f6622ea8a7a459c303aefcc97902
parenteac3e5c3fb7c121158fc4ae5117e6acb7fb5220e
[flang] Don't force SET_EXPONENT(I=...) argument to integer(4)

The implementation of the folding code for SET_EXPONENT() was written
in such a fashion as to convert the I= actual argument value to a 32-bit
integer.  Which is usually not a problem, but it's not always correct
and a test case ran into trouble with it.  Fix to allow any kind of
INTEGER without conversion.

Differential Revision: https://reviews.llvm.org/D135203
flang/include/flang/Evaluate/real.h
flang/lib/Evaluate/fold-real.cpp
flang/lib/Evaluate/real.cpp