[flang-commits] [flang] [flang][OpenMP] Add type-param-inquiry checks for non-list clauses (PR #203059)

Paul Osmialowski via flang-commits flang-commits at lists.llvm.org
Fri Jun 12 09:26:50 PDT 2026


pawosm-arm wrote:

> Could you maybe try running that test from a debugger? Maybe it will print more details about the actual problem.

It shows that there is actually `brk` opcode which causes the crash, and that it has been reached:

```
warning: OpenMP support for version 60 in flang is still incomplete [-Wexperimental-option]

Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000aaaab0d0a238 in Fortran::semantics::OmpStructureChecker::Enter(Fortran::parser::OpenMPDepobjConstruct const&) ()
```
And `bt` command prints identical trace. The `disassemble` command points at the very end of the `Enter` function:
```
   0x0000aaaab0d0a22c <+920>:   cmp     x24, x22
   0x0000aaaab0d0a230 <+924>:   b.ne    0xaaaab0d0a024 <_ZN7Fortran9semantics19OmpStructureChecker5EnterERKNS_6parser21OpenMPDepobjConstructE+400>  // b.any
   0x0000aaaab0d0a234 <+928>:   b       0xaaaab0d0a198 <_ZN7Fortran9semantics19OmpStructureChecker5EnterERKNS_6parser21OpenMPDepobjConstructE+772>
=> 0x0000aaaab0d0a238 <+932>:   brk     #0x1
   0x0000aaaab0d0a23c <+936>:   add     x0, x20, #0x10
   0x0000aaaab0d0a240 <+940>:   add     x1, x19, #0x10
   0x0000aaaab0d0a244 <+944>:   sub     x2, x29, #0x4
   0x0000aaaab0d0a248 <+948>:   bl      0xaaaab0d7d278 <_ZNSt3__16vectorIN7Fortran9semantics25DirectiveStructureCheckerIN4llvm3omp9DirectiveENS5_6ClauseENS1_6parser9OmpClauseELm137EE16DirectiveContextENS_9allocatorISB_EEE24__emplace_back_slow_pathB9sqn230000IJRKNS8_9CharBlockERS6_EEEPSB_DpOT_>
   0x0000aaaab0d0a24c <+952>:   b       0xaaaab0d09f34 <_ZN7Fortran9semantics19OmpStructureChecker5EnterERKNS_6parser21OpenMPDepobjConstructE+160>
   0x0000aaaab0d0a250 <+956>:   cmn     w8, #0x1
   0x0000aaaab0d0a254 <+960>:   b.ne    0xaaaab0d0a264 <_ZN7Fortran9semantics19OmpStructureChecker5EnterERKNS_6parser21OpenMPDepobjConstructE+976>  // b.any
   0x0000aaaab0d0a258 <+964>:   adrp    x0, 0xaaaaad76c000
   0x0000aaaab0d0a25c <+968>:   add     x0, x0, #0xd35
   0x0000aaaab0d0a260 <+972>:   bl      0xaaaaafaad99c <_ZNSt3__126__throw_bad_variant_accessB9sqn230000EPKc>
   0x0000aaaab0d0a264 <+976>:   adrp    x0, 0xaaaaacd9b000
   0x0000aaaab0d0a268 <+980>:   add     x0, x0, #0x6e8
   0x0000aaaab0d0a26c <+984>:   bl      0xaaaaafaad99c <_ZNSt3__126__throw_bad_variant_accessB9sqn230000EPKc>
End of assembler dump.
```
Among various variants of the `Enter` methods, I can't see any with a destructive instruction (e.g. used in an error condition), so it could have been inlined from libc++, e.g. as a part of `push_back()` method that may not like what's being stored into a container. Just speculating.


https://github.com/llvm/llvm-project/pull/203059


More information about the flang-commits mailing list