[PATCH] D91560: [flang] Duplicate names for ac-implied-do variables erroneously cause errors

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 15:02:28 PST 2020


PeteSteinfeld added inline comments.


================
Comment at: flang/test/Evaluate/folding15.f90:7
+  integer :: dups(21) = &
+    [ ((iDuplicate, iDuplicate = 1,j), &
+       (2 * iDuplicate, iDuplicate = j,3 ), &
----------------
klausler wrote:
> PeteSteinfeld wrote:
> > klausler wrote:
> > > Can you test using the "outer" iDuplicate as part of an implied DO loop bound expression for the "inner" iDuplicate, please?
> > I'm not sure what you mean.  In the two tests I added, the "iDuplicate" variables are defined in parallel scopes.  It's not allowed to have an ac-implied-do variable with the same name as one in an outer scope.
> > 
> > Can you give me an example?
> Actually, I can't, because I think that C7115 implies that the kind of scoping that you're implementing isn't necessary in the first place.
Right.  My reading of the standard is that C7115 precludes nested scopes of ac-implied-do variables with the same name.  But section 19.4, paragraph 5 implies that parallel regions with the same name are allowed.  C7115 was already tested in tests/Semantics/array-constr-values.f90, and it still passes with these changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91560/new/

https://reviews.llvm.org/D91560



More information about the llvm-commits mailing list