[flang] Change internal errors in RESHAPE runtime routine to user errors
authorPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 11 Feb 2022 22:44:42 +0000 (14:44 -0800)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 11 Feb 2022 23:51:21 +0000 (15:51 -0800)
commitbdf573652138fee827e18e636d92975171b566af
tree90e5ad87393cc8d4b6a30356e4f27bebbebbf7fe
parent8f0b2ac140c36f37597deef66bea8a7739c18a7b
[flang] Change internal errors in RESHAPE runtime routine to user errors

There are several checks in the runtime routine for the RESHAPE
intrinsic.  Some checks verify things that should have been checked at
compile time while others represent user errors.

This update changes the checks for user errors into calls to "Crash"
which include information about the failing check.  This identifies them
as user errors rather than compiler errors.

I also verified that the checks that remain as internal errors are also
checked by the front end.  I added a test to the front end's RESHAPE
test to complete the checks.

Differential Revision: https://reviews.llvm.org/D119596
flang/runtime/transformational.cpp
flang/test/Semantics/reshape.f90