[flang] Fix for broken/degenerate forall case
authorValentin Clement <clementval@gmail.com>
Fri, 1 Jul 2022 08:36:45 +0000 (10:36 +0200)
committerValentin Clement <clementval@gmail.com>
Fri, 1 Jul 2022 08:37:15 +0000 (10:37 +0200)
commit0dd4fb0408ed980de2c100905e68a4adf9987c61
tree6208e42903e689e83d4838b505457b781d4149fd
parentde3fb0f29ecfd4e7327f2ae409936f8b4f251201
[flang] Fix for broken/degenerate forall case

Fix for broken/degenerate forall case where there is no assignment to an
array under the explicit iteration space. While this is a multiple
assignment, semantics only raises a warning.
The fix is to add a test that the explicit space has any sort of array
to be updated, and if not then the do_loop nest will not require a
terminator to forward array values to the next iteration.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128973

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/ConvertExpr.cpp