From OMP 5.0 [2.17.8]
Restriction:
If memory-order-clause is release,acquire, or acq_rel, list items must not be specified on the flush directive.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
For a test as below
TYPE somestr real :: rr end type TYPE(somestr) :: structObj !$omp flush (structObj%rr)
I could see nag, intel and gfortran producing error when a list item is structObj%rr.
I didn't find inside standard though.
So should this be flagged as well an error?
Rebased on top of master to try to resolve buildbot failure.
https://reviews.llvm.org/harbormaster/build/99902/
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
---|---|---|
423 ↗ | (On Diff #299669) | Did you check if clang test are still passing with this change? |
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
---|---|---|
423 ↗ | (On Diff #299669) | With ninja check-clang check-flang all seems well. |
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
---|---|---|
423 ↗ | (On Diff #299669) | Which bot do you see failing? |
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
---|---|---|
423 ↗ | (On Diff #299669) | From[1] I specifically failing[2] to apply patch. [1] https://reviews.llvm.org/harbormaster/build/99908/ |
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
---|---|---|
423 ↗ | (On Diff #299669) | Looks like it a conflict problem. You should rebase one more time. |
This commit tries to get a workaround for not chaning the parser as well as adding semantic checks.
The function FindClause was used earlier to get information from context.
Above function works on clauses which come under parser::OmpClause, currently flush doesn't fall under it.
flang/lib/Semantics/check-omp-structure.cpp | ||
---|---|---|
551 | It makes little sense to use the OmpClause infrastructure to check something enforced by the parser. | |
flang/test/Semantics/omp-flush.f90 | ||
36 ↗ | (On Diff #302333) | Any reason to have upper and lower cases? Same questions for the others below |
flang/test/Semantics/omp-flush01.f90 | ||
17 | Any reason to have upper and lower cases? Same questions for the others below | |
llvm/include/llvm/Frontend/OpenMP/OMP.td | ||
423 ↗ | (On Diff #302333) | Since you are not using the OmpClause this change is not needed here. |
Some small comments
flang/lib/Semantics/check-omp-structure.cpp | ||
---|---|---|
218 | Isn't this line exceeding the character limit? | |
flang/test/Semantics/omp-flush01.f90 | ||
28 | Why is the error reported twice here? Would it not be nicer to have a list of memory-order-clause and then the error being reported by the semantic check? I mean it would be more user friendly. |
flang/test/Semantics/omp-flush01.f90 | ||
---|---|---|
28 | It's a known issue due the improper error recovery in openmp. Yes, I have forwarded the errors to semantic phase. |
flang/test/Semantics/omp-flush01.f90 | ||
---|---|---|
28 | If you have forwarded the errors to semantic then why is there still two syntax error lines? |
flang/test/Semantics/omp-flush01.f90 | ||
---|---|---|
28 | The errors forwarded to semantics are something like The test cases over here have clauses which don't fall under memory-order-clause, hence the parser becomes very stricter over here and catches them in parsing stage. |
LGTM. Please wait for the approval from someone from the OpenMP side.
flang/test/Semantics/omp-flush01.f90 | ||
---|---|---|
28 | Ok I see. It would be nice to fix the double reporting of error here but I guess it can be done in a separate patch. Can you add an entry in the progress document to not forget this issue. |
Thank you!
flang/test/Semantics/omp-flush01.f90 | ||
---|---|---|
28 | Kiran Kumar from AMD was looking into improving the error messages for OMP parts. |
Isn't this line exceeding the character limit?