[flang] Fold IS_CONTIGUOUS for TYPE(*) when possible
authorJean Perier <jperier@nvidia.com>
Fri, 14 Apr 2023 06:42:15 +0000 (08:42 +0200)
committerJean Perier <jperier@nvidia.com>
Fri, 14 Apr 2023 06:42:25 +0000 (08:42 +0200)
commit6f5df4199e64020d9290838a72ba79b74ed91269
treeef5aa59e28c627e716a735c4f398cfcc1c5d42d3
parent75f1f158812dabc03e70697b6b9c272230bce63d
[flang] Fold IS_CONTIGUOUS for TYPE(*) when possible

TYPE(*) arguments fell through in IS_CONTIGUOUS folding
because they are not Expr<SomeType>. Expose entry point for
symbols in IsContiguous and use that.

The added test revealed that IS_CONTIGUOUS was folded to
false for assumed rank arguments. Fix this: the contiguity of
assumed rank without the CONTIGUOUS argument can only be
verified at runtime.

Differential Revision: https://reviews.llvm.org/D148128
flang/include/flang/Evaluate/check-expression.h
flang/lib/Evaluate/check-expression.cpp
flang/lib/Evaluate/fold-logical.cpp
flang/lib/Semantics/check-declarations.cpp
flang/test/Evaluate/rewrite03.f90 [new file with mode: 0644]