llvm-project/flang/lib/Evaluate
Jean Perier ca46521a4d [flang] UBOUND() edge case: empty dimension
Similarly to LBOUND in https://reviews.llvm.org/D121488, UBOUND must
return zero for an empty dimension, no matter the specification
expression.

Add a GetUBOUND method to be used in expression rewrite that prevents
folding UBOUND to a bound specification expression if the extent is
not a compile time constant.

Fold the case where the extents is known to be zero (and also deal with
this case in LBOUND since we can and should to comply with constant
expression requirements).

Differential Revision: https://reviews.llvm.org/D122242
2022-03-24 09:07:15 +01:00
..
CMakeLists.txt [flang] Improve runtime interface with C99 complex 2021-10-01 08:45:24 +02:00
call.cpp [flang][NFC] Address warnings from Windows build 2021-10-12 16:00:09 -07:00
character.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
characteristics.cpp [flang] Remove bogus messages for actual/dummy procedure argument compatibility 2022-03-02 16:00:36 -08:00
check-expression.cpp [flang] UBOUND() edge case: empty dimension 2022-03-24 09:07:15 +01:00
common.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
complex.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
constant.cpp [flang] LBOUND() edge case: empty dimension 2022-03-14 11:16:09 -07:00
expression.cpp [flang] Fold SCALE() 2022-01-15 09:31:00 -08:00
fold-character.cpp [flang] Fold SCALE() 2022-01-15 09:31:00 -08:00
fold-complex.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
fold-designator.cpp [flang] LBOUND() edge case: empty dimension 2022-03-14 11:16:09 -07:00
fold-implementation.h [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
fold-integer.cpp [flang] UBOUND() edge case: empty dimension 2022-03-24 09:07:15 +01:00
fold-logical.cpp Add ieee_is_normal/ieee_is_negative to ieee_arithmetic module. 2022-01-26 11:33:23 +03:00
fold-real.cpp [flang][Evaluate] Fold DBLE 2022-03-23 17:27:05 +00:00
fold-reduction.cpp [flang] Fold FINDLOC() 2021-09-30 12:08:10 -07:00
fold-reduction.h [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
fold.cpp [flang] LBOUND() edge case: empty dimension 2022-03-14 11:16:09 -07:00
formatting.cpp [flang] Fold SCALE() 2022-01-15 09:31:00 -08:00
host.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00
host.h [flang] Fix/work around warnings from GCC 11 2022-02-01 11:54:04 -08:00
initial-image.cpp [flang] Allow DATA initialization of derived types w/ allocatable components 2022-02-14 10:43:49 -08:00
int-power.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
integer.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
intrinsics-library.cpp [flang] Support extension intrinsic function variations on ABS 2022-01-13 17:10:44 -08:00
intrinsics.cpp [flang] Accept legacy aliases for intrinsic function names 2022-03-18 16:53:13 -07:00
logical.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
real.cpp [flang] Fix test regression from SQRT folding 2021-09-30 11:35:44 -07:00
shape.cpp [flang] UBOUND() edge case: empty dimension 2022-03-24 09:07:15 +01:00
static-data.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
tools.cpp [flang] fulfill -Msave/-fno-automatic in main programs too 2022-03-15 09:33:07 +01:00
type.cpp [flang] [NFC] Repair build with GCC 7.3 2021-06-22 13:52:30 -07:00
variable.cpp [flang] Distinguish usage and portability warning messages 2022-03-08 17:24:52 -08:00