This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix bug that disallows coindexed-object in event-post-stmt
Needs RevisionPublic

Authored by ktras on May 17 2023, 6:29 PM.

Details

Summary

Fix bug in check for constraint C1604. The bug disallows the
event-variable in an event-post-stmt to be a coindexed-object, which
is allowed by the standard. Fix event-post-stmt and event-wait-stmt
tests so that the type of error that hides other errors are isolated
in one test, leaving one test with only standard conforming
statements. This change in testing makes it possible to check
that an event-variable in an event-post-stmt that is a
coindexed-object is now accepted by the compiler after this bugfix.

Diff Detail

Event Timeline

ktras created this revision.May 17 2023, 6:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2023, 6:29 PM
ktras requested review of this revision.May 17 2023, 6:29 PM
PeteSteinfeld requested changes to this revision.May 17 2023, 7:24 PM

Thanks, for working on this, @krtras.

All builds and tests correctly and looks good.

This revision now requires changes to proceed.May 17 2023, 7:24 PM

Thanks for the review, @PeteSteinfeld. You have requested changes to this revision but from the text of your comment, it seems like you accidentally requested changes. If you did mean to request changes, please let me know what needs to be updated.

PeteSteinfeld accepted this revision.May 18 2023, 11:17 AM

Oops. You're correct @ktras. This patch is good to go.

This revision is now accepted and ready to land.May 18 2023, 11:17 AM
PeteSteinfeld requested changes to this revision.May 19 2023, 11:16 AM

Thanks for working on this, but this code doesn't work for arrays of coarrays. Here's a test case that shows the problem:

Program bug
  Use Iso_Fortran_Env
  Implicit None
  Integer i
  Type(event_type) :: ev(2)[*]
  If (This_Image()==Num_Images()) Then
    Do i=1,Size(ev)
      Event Post (ev(i)[1])
    End Do
  End If
End Program
This revision now requires changes to proceed.May 19 2023, 11:16 AM