[flang] Fixes for DO constraint C1124
authorPeter Steinfeld <psteinfeld@nvidia.com>
Thu, 27 Jun 2019 19:33:36 +0000 (12:33 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Thu, 27 Jun 2019 19:33:36 +0000 (12:33 -0700)
commitaafeb349623276b24151f6799b3c1b2a70dbdc9b
treeaf0ebf76bb0f534a82f6f7c47eaa5aac4f82496e
parent4711129fcc61658ace0fd2e42e7d5d6fde88b099
[flang] Fixes for DO constraint C1124
The constraint says that a variable-name in a locality-spec shall be the name
of a variable in the innermost executable construct or scoping unit that
includes the DO CONCURRENT statement.  This check was already being made in
resolve-names.cc for LOCAL and LOCAL_INIT locality specs but not for the
SHARED locality spec.  Also, there was some code in check-do.cc that was
intended to be used to enforce this constraint at some time in the future.

I added code to resolve-names.cc to extend the checking to the SHARED locality
spec and removed the unused code from check-do.cc.  I also extended the
existing tests in resolve35.f90 to exercise the new code.

Original-commit: flang-compiler/f18@b421923d9403c3efe320e5ec2b722b88d1fdbd73
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Tree-same-pre-rewrite: false
flang/lib/semantics/check-do.cc
flang/lib/semantics/resolve-names.cc
flang/test/semantics/resolve35.f90