[all-commits] [llvm/llvm-project] 8e8113: [Flang][OpenMP] Allow Fortran BLOCK construct insi...
jay0x via All-commits
all-commits at lists.llvm.org
Mon Apr 27 08:36:26 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8e8113fcb1bf54e7ea92151f8fb4b78fb79d3026
https://github.com/llvm/llvm-project/commit/8e8113fcb1bf54e7ea92151f8fb4b78fb79d3026
Author: jay0x <90309873+blazie2004 at users.noreply.github.com>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
M flang/lib/Semantics/check-omp-structure.cpp
A flang/test/Semantics/OpenMP/workshare06.f90
Log Message:
-----------
[Flang][OpenMP] Allow Fortran BLOCK construct inside WORKSHARE region (#193352)
**Problem**
Flang incorrectly rejects Fortran BLOCK constructs inside OpenMP
WORKSHARE regions. This fixes the semantic check to recursively validate
the contents of BLOCK constructs instead of rejecting them.
The Fortran BLOCK construct (F2008) is a transparent scoping wrapper
that does not affect execution semantics. When a BLOCK appears inside a
WORKSHARE region, the restriction on allowed statements should apply to
the contents of the BLOCK, not the BLOCK construct itself.
**Fix**
The function CheckWorkshareBlockStmts (check-omp-structure.cpp) loops
through each statement inside a WORKSHARE region and checks if it's
allowed.
Before this fix, it only recognized:
```
Assignments, FORALL, WHERE statements
OpenMP constructs (ATOMIC, CRITICAL, PARALLEL)
When it saw a Fortran BLOCK, it didn't recognize it and threw an error.
```
When we see a BLOCK construct, instead of rejecting it, we "look inside"
and check if the statements inside the BLOCK are valid. This is done by
calling the same function recursively on the BLOCK's contents.
Issue : [192930](https://github.com/llvm/llvm-project/issues/192930)
---------
Co-authored-by: Jay Satish Kumar Patel <kumarpat at pe31.hpc.amslabs.hpecorp.net>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list