Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flang][OpenMP] Compilation abnormally terminates when common block is specified in list of lastprivate clause in sections construct #121719

Open
ohno-fj opened this issue Jan 6, 2025 · 1 comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] flang:ir flang:openmp

Comments

@ohno-fj
Copy link

ohno-fj commented Jan 6, 2025

Version of flang : 20.0.0(c5492e3c65e40cdcab9771b692f9ad437c65aa04)/AArch64

When common block is specified in list of lastprivate clause in sections construct, a compilation terminates abnormally.
When firstprivate and private are used instead of lastprivate, the compilation succeeds.

The following are the test program, Flang, Gfortran and ifx compilation/execution result.

snfmm221_2322.f90:

program main
  common /com/ i
  i=1
!$omp sections lastprivate(/com/)
  i=2
!$omp end sections
  write(6,*) "i = ", i
end program main
$ flang -fopenmp snfmm221_2322.f90
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
flang: /work/groups/ssoft/compiler/llvm/src/llvm-main/flang/lib/Lower/Bridge.cpp:894: virtual void {anonymous}::FirConverter::copyHostAssociateVar(const Fortran::semantics::Symbol&, mlir::OpBuilder::InsertPoint*): Assertion `sym.has<Fortran::semantics::HostAssocDetails>() && "No host-association found"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -fopenmp -resource-dir /work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/lib/clang/20 -mframe-pointer=non-leaf -o /tmp/snfmm221_2322-c33173.o -x f95-cpp-input snfmm221_2322.f90
 #0 0x000040001c2035d0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/work/groups/ssoft/compiler/llvm/aarch64/main-latest/lib/libLLVM.so.20.0git+0x5a035d0)
 #1 0x000040001c201658 llvm::sys::RunSignalHandlers() (/work/groups/ssoft/compiler/llvm/aarch64/main-latest/lib/libLLVM.so.20.0git+0x5a01658)
 #2 0x000040001c2017b0 SignalHandler(int) Signals.cpp:0:0
 #3 0x00004000118607a0 (linux-vdso.so.1+0x7a0)
 #4 0x0000400021066274 raise (/lib64/libc.so.6+0x36274)
 #5 0x0000400021050a2c abort (/lib64/libc.so.6+0x20a2c)
 #6 0x000040002105fba0 __assert_fail_base (/lib64/libc.so.6+0x2fba0)
 #7 0x000040002105fc18 __assert_perror_fail (/lib64/libc.so.6+0x2fc18)
 #8 0x000000000592f228 (anonymous namespace)::FirConverter::copyHostAssociateVar(Fortran::semantics::Symbol const&, mlir::OpBuilder::InsertPoint*) Bridge.cpp:0:0
 #9 0x0000000005cbb968 genSectionsOp(Fortran::lower::AbstractConverter&, Fortran::lower::SymMap&, Fortran::semantics::SemanticsContext&, Fortran::lower::pft::Evaluation&, mlir::Location, llvm::SmallVector<tomp::DirectiveWithClauses<Fortran::lower::omp::Clause>, 0u> const&, tomp::DirectiveWithClauses<Fortran::lower::omp::Clause> const*, Fortran::parser::OmpSectionBlocks const&) OpenMP.cpp:0:0
#10 0x0000000005cc35d8 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<void (*)(genOMP(Fortran::lower::AbstractConverter&, Fortran::lower::SymMap&, Fortran::semantics::SemanticsContext&, Fortran::lower::pft::Evaluation&, Fortran::parser::OpenMPConstruct const&)::'lambda'(auto&&)&&, std::variant<Fortran::parser::OpenMPStandaloneConstruct, Fortran::parser::OpenMPSectionsConstruct, Fortran::parser::OpenMPSectionConstruct, Fortran::parser::OpenMPLoopConstruct, Fortran::parser::OpenMPBlockConstruct, Fortran::parser::OpenMPAtomicConstruct, Fortran::parser::OpenMPDeclarativeAllocate, Fortran::parser::OpenMPErrorConstruct, Fortran::parser::OpenMPExecutableAllocate, Fortran::parser::OpenMPAllocatorsConstruct, Fortran::parser::OpenMPCriticalConstruct> const&)>, std::tuple<std::variant<Fortran::parser::OpenMPStandaloneConstruct, Fortran::parser::OpenMPSectionsConstruct, Fortran::parser::OpenMPSectionConstruct, Fortran::parser::OpenMPLoopConstruct, Fortran::parser::OpenMPBlockConstruct, Fortran::parser::OpenMPAtomicConstruct, Fortran::parser::OpenMPDeclarativeAllocate, Fortran::parser::OpenMPErrorConstruct, Fortran::parser::OpenMPExecutableAllocate, Fortran::parser::OpenMPAllocatorsConstruct, Fortran::parser::OpenMPCriticalConstruct> const&>, std::integer_sequence<unsigned long, 1ul>>::__visit_invoke(genOMP(Fortran::lower::AbstractConverter&, Fortran::lower::SymMap&, Fortran::semantics::SemanticsContext&, Fortran::lower::pft::Evaluation&, Fortran::parser::OpenMPConstruct const&)::'lambda'(auto&&)&&, std::variant<Fortran::parser::OpenMPStandaloneConstruct, Fortran::parser::OpenMPSectionsConstruct, Fortran::parser::OpenMPSectionConstruct, Fortran::parser::OpenMPLoopConstruct, Fortran::parser::OpenMPBlockConstruct, Fortran::parser::OpenMPAtomicConstruct, Fortran::parser::OpenMPDeclarativeAllocate, Fortran::parser::OpenMPErrorConstruct, Fortran::parser::OpenMPExecutableAllocate, Fortran::parser::OpenMPAllocatorsConstruct, Fortran::parser::OpenMPCriticalConstruct> const&) OpenMP.cpp:0:0
#11 0x0000000005ca7904 Fortran::lower::genOpenMPConstruct(Fortran::lower::AbstractConverter&, Fortran::lower::SymMap&, Fortran::semantics::SemanticsContext&, Fortran::lower::pft::Evaluation&, Fortran::parser::OpenMPConstruct const&) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x5ca7904)
#12 0x00000000058e6530 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<void (*)(Fortran::common::visitors<auto Fortran::lower::pft::ReferenceVariantBase<true, Fortran::parser::AllocateStmt, Fortran::parser::AssignmentStmt, Fortran::parser::BackspaceStmt, Fortran::parser::CallStmt, Fortran::parser::CloseStmt, Fortran::parser::ContinueStmt, Fortran::parser::CycleStmt, Fortran::parser::DeallocateStmt, Fortran::parser::EndfileStmt, Fortran::parser::EventPostStmt, Fortran::parser::EventWaitStmt, Fortran::parser::ExitStmt, Fortran::parser::FailImageStmt, Fortran::parser::FlushStmt, Fortran::parser::FormTeamStmt, Fortran::parser::GotoStmt, Fortran::parser::IfStmt, Fortran::parser::InquireStmt, Fortran::parser::LockStmt, Fortran::parser::NotifyWaitStmt, Fortran::parser::NullifyStmt, Fortran::parser::OpenStmt, Fortran::parser::PointerAssignmentStmt, Fortran::parser::PrintStmt, Fortran::parser::ReadStmt, Fortran::parser::ReturnStmt, Fortran::parser::RewindStmt, Fortran::parser::StopStmt, Fortran::parser::SyncAllStmt, Fortran::parser::SyncImagesStmt, Fortran::parser::SyncMemoryStmt, Fortran::parser::SyncTeamStmt, Fortran::parser::UnlockStmt, Fortran::parser::WaitStmt, Fortran::parser::WhereStmt, Fortran::parser::WriteStmt, Fortran::parser::ComputedGotoStmt, Fortran::parser::ForallStmt, Fortran::parser::ArithmeticIfStmt, Fortran::parser::AssignStmt, Fortran::parser::AssignedGotoStmt, Fortran::parser::PauseStmt, Fortran::parser::EntryStmt, Fortran::parser::FormatStmt, Fortran::parser::AssociateStmt, Fortran::parser::EndAssociateStmt, Fortran::parser::BlockStmt, Fortran::parser::EndBlockStmt, Fortran::parser::SelectCaseStmt, Fortran::parser::CaseStmt, Fortran::parser::EndSelectStmt, Fortran::parser::ChangeTeamStmt, Fortran::parser::EndChangeTeamStmt, Fortran::parser::CriticalStmt, Fortran::parser::EndCriticalStmt, Fortran::parser::NonLabelDoStmt, Fortran::parser::EndDoStmt, Fortran::parser::IfThenStmt, Fortran::parser::ElseIfStmt, Fortran::parser::ElseStmt, Fortran::parser::EndIfStmt, Fortran::parser::SelectRankStmt, Fortran::parser::SelectRankCaseStmt, Fortran::parser::SelectTypeStmt, Fortran::parser::TypeGuardStmt, Fortran::parser::WhereConstructStmt, Fortran::parser::MaskedElsewhereStmt, Fortran::parser::ElsewhereStmt, Fortran::parser::EndWhereStmt, Fortran::parser::ForallConstructStmt, Fortran::parser::EndForallStmt, Fortran::parser::EndProgramStmt, Fortran::parser::EndFunctionStmt, Fortran::parser::EndSubroutineStmt, Fortran::parser::EndMpSubprogramStmt, Fortran::parser::AssociateConstruct, Fortran::parser::BlockConstruct, Fortran::parser::CaseConstruct, Fortran::parser::ChangeTeamConstruct, Fortran::parser::CriticalConstruct, Fortran::parser::DoConstruct, Fortran::parser::IfConstruct, Fortran::parser::SelectRankConstruct, Fortran::parser::SelectTypeConstruct, Fortran::parser::WhereConstruct, Fortran::parser::ForallConstruct, Fortran::parser::CompilerDirective, Fortran::parser::OpenACCConstruct, Fortran::parser::OpenACCRoutineConstruct, Fortran::parser::OpenACCDeclarativeConstruct, Fortran::parser::OpenMPConstruct, Fortran::parser::OpenMPDeclarativeConstruct, Fortran::parser::OmpEndLoopDirective, Fortran::parser::CUFKernelDoConstruct>::visit<(anonymous namespace)::FirConverter::genFIR(Fortran::lower::pft::Evaluation&, bool)::'lambda'(auto const&)>(auto&&) const::'lambda'(auto)>&&, std::variant<Fortran::common::Reference<Fortran::parser::AllocateStmt const>, Fortran::common::Reference<Fortran::parser::AssignmentStmt const>, Fortran::common::Reference<Fortran::parser::BackspaceStmt const>, Fortran::common::Reference<Fortran::parser::CallStmt const>, Fortran::common::Reference<Fortran::parser::CloseStmt const>, Fortran::common::Reference<Fortran::parser::ContinueStmt const>, Fortran::common::Reference<Fortran::parser::CycleStmt const>, Fortran::common::Reference<Fortran::parser::DeallocateStmt const>, Fortran::common::Reference<Fortran::parser::EndfileStmt const>, Fortran::common::Reference<Fortran::parser::EventPostStmt const>, Fortran::common::Reference<Fortran::parser::EventWaitStmt const>, Fortran::common::Reference<Fortran::parser::ExitStmt const>, Fortran::common::Reference<Fortran::parser::FailImageStmt const>, Fortran::common::Reference<Fortran::parser::FlushStmt const>, Fortran::common::Reference<Fortran::parser::FormTeamStmt const>, Fortran::common::Reference<Fortran::parser::GotoStmt const>, Fortran::common::Reference<Fortran::parser::IfStmt const>, Fortran::common::Reference<Fortran::parser::InquireStmt const>, Fortran::common::Reference<Fortran::parser::LockStmt const>, Fortran::common::Reference<Fortran::parser::NotifyWaitStmt const>, Fortran::common::Reference<Fortran::parser::NullifyStmt const>, Fortran::common::Reference<Fortran::parser::OpenStmt const>, Fortran::common::Reference<Fortran::parser::PointerAssignmentStmt const>, Fortran::common::Reference<Fortran::parser::PrintStmt const>, Fortran::common::Reference<Fortran::parser::ReadStmt const>, Fortran::common::Reference<Fortran::parser::ReturnStmt const>, Fortran::common::Reference<Fortran::parser::RewindStmt const>, Fortran::common::Reference<Fortran::parser::StopStmt const>, Fortran::common::Reference<Fortran::parser::SyncAllStmt const>, Fortran::common::Reference<Fortran::parser::SyncImagesStmt const>, Fortran::common::Reference<Fortran::parser::SyncMemoryStmt const>, Fortran::common::Reference<Fortran::parser::SyncTeamStmt const>, Fortran::common::Reference<Fortran::parser::UnlockStmt const>, Fortran::common::Reference<Fortran::parser::WaitStmt const>, Fortran::common::Reference<Fortran::parser::WhereStmt const>, Fortran::common::Reference<Fortran::parser::WriteStmt const>, Fortran::common::Reference<Fortran::parser::ComputedGotoStmt const>, Fortran::common::Reference<Fortran::parser::ForallStmt const>, Fortran::common::Reference<Fortran::parser::ArithmeticIfStmt const>, Fortran::common::Reference<Fortran::parser::AssignStmt const>, Fortran::common::Reference<Fortran::parser::AssignedGotoStmt const>, Fortran::common::Reference<Fortran::parser::PauseStmt const>, Fortran::common::Reference<Fortran::parser::EntryStmt const>, Fortran::common::Reference<Fortran::parser::FormatStmt const>, Fortran::common::Reference<Fortran::parser::AssociateStmt const>, Fortran::common::Reference<Fortran::parser::EndAssociateStmt const>, Fortran::common::Reference<Fortran::parser::BlockStmt const>, Fortran::common::Reference<Fortran::parser::EndBlockStmt const>, Fortran::common::Reference<Fortran::parser::SelectCaseStmt const>, Fortran::common::Reference<Fortran::parser::CaseStmt const>, Fortran::common::Reference<Fortran::parser::EndSelectStmt const>, Fortran::common::Reference<Fortran::parser::ChangeTeamStmt const>, Fortran::common::Reference<Fortran::parser::EndChangeTeamStmt const>, Fortran::common::Reference<Fortran::parser::CriticalStmt const>, Fortran::common::Reference<Fortran::parser::EndCriticalStmt const>, Fortran::common::Reference<Fortran::parser::NonLabelDoStmt const>, Fortran::common::Reference<Fortran::parser::EndDoStmt const>, Fortran::common::Reference<Fortran::parser::IfThenStmt const>, Fortran::common::Reference<Fortran::parser::ElseIfStmt const>, Fortran::common::Reference<Fortran::parser::ElseStmt const>, Fortran::common::Reference<Fortran::parser::EndIfStmt const>, Fortran::common::Reference<Fortran::parser::SelectRankStmt const>, Fortran::common::Reference<Fortran::parser::SelectRankCaseStmt const>, Fortran::common::Reference<Fortran::parser::SelectTypeStmt const>, Fortran::common::Reference<Fortran::parser::TypeGuardStmt const>, Fortran::common::Reference<Fortran::parser::WhereConstructStmt const>, Fortran::common::Reference<Fortran::parser::MaskedElsewhereStmt const>, Fortran::common::Reference<Fortran::parser::ElsewhereStmt const>, Fortran::common::Reference<Fortran::parser::EndWhereStmt const>, Fortran::common::Reference<Fortran::parser::ForallConstructStmt const>, Fortran::common::Reference<Fortran::parser::EndForallStmt const>, Fortran::common::Reference<Fortran::parser::EndProgramStmt const>, Fortran::common::Reference<Fortran::parser::EndFunctionStmt const>, Fortran::common::Reference<Fortran::parser::EndSubroutineStmt const>, Fortran::common::Reference<Fortran::parser::EndMpSubprogramStmt const>, Fortran::common::Reference<Fortran::parser::AssociateConstruct const>, Fortran::common::Reference<Fortran::parser::BlockConstruct const>, Fortran::common::Reference<Fortran::parser::CaseConstruct const>, Fortran::common::Reference<Fortran::parser::ChangeTeamConstruct const>, Fortran::common::Reference<Fortran::parser::CriticalConstruct const>, Fortran::common::Reference<Fortran::parser::DoConstruct const>, Fortran::common::Reference<Fortran::parser::IfConstruct const>, Fortran::common::Reference<Fortran::parser::SelectRankConstruct const>, Fortran::common::Reference<Fortran::parser::SelectTypeConstruct const>, Fortran::common::Reference<Fortran::parser::WhereConstruct const>, Fortran::common::Reference<Fortran::parser::ForallConstruct const>, Fortran::common::Reference<Fortran::parser::CompilerDirective const>, Fortran::common::Reference<Fortran::parser::OpenACCConstruct const>, Fortran::common::Reference<Fortran::parser::OpenACCRoutineConstruct const>, Fortran::common::Reference<Fortran::parser::OpenACCDeclarativeConstruct const>, Fortran::common::Reference<Fortran::parser::OpenMPConstruct const>, Fortran::common::Reference<Fortran::parser::OpenMPDeclarativeConstruct const>, Fortran::common::Reference<Fortran::parser::OmpEndLoopDirective const>, Fortran::common::Reference<Fortran::parser::CUFKernelDoConstruct const>> const&)>, std::tuple<std::variant<Fortran::common::Reference<Fortran::parser::AllocateStmt const>, Fortran::common::Reference<Fortran::parser::AssignmentStmt const>, Fortran::common::Reference<Fortran::parser::BackspaceStmt const>, Fortran::common::Reference<Fortran::parser::CallStmt const>, Fortran::common::Reference<Fortran::parser::CloseStmt const>, Fortran::common::Reference<Fortran::parser::ContinueStmt const>, Fortran::common::Reference<Fortran::parser::CycleStmt const>, Fortran::common::Reference<Fortran::parser::DeallocateStmt const>, Fortran::common::Reference<Fortran::parser::EndfileStmt const>, Fortran::common::Reference<Fortran::parser::EventPostStmt const>, Fortran::common::Reference<Fortran::parser::EventWaitStmt const>, Fortran::common::Reference<Fortran::parser::ExitStmt const>, Fortran::common::Reference<Fortran::parser::FailImageStmt const>, Fortran::common::Reference<Fortran::parser::FlushStmt const>, Fortran::common::Reference<Fortran::parser::FormTeamStmt const>, Fortran::common::Reference<Fortran::parser::GotoStmt const>, Fortran::common::Reference<Fortran::parser::IfStmt const>, Fortran::common::Reference<Fortran::parser::InquireStmt const>, Fortran::common::Reference<Fortran::parser::LockStmt const>, Fortran::common::Reference<Fortran::parser::NotifyWaitStmt const>, Fortran::common::Reference<Fortran::parser::NullifyStmt const>, Fortran::common::Reference<Fortran::parser::OpenStmt const>, Fortran::common::Reference<Fortran::parser::PointerAssignmentStmt const>, Fortran::common::Reference<Fortran::parser::PrintStmt const>, Fortran::common::Reference<Fortran::parser::ReadStmt const>, Fortran::common::Reference<Fortran::parser::ReturnStmt const>, Fortran::common::Reference<Fortran::parser::RewindStmt const>, Fortran::common::Reference<Fortran::parser::StopStmt const>, Fortran::common::Reference<Fortran::parser::SyncAllStmt const>, Fortran::common::Reference<Fortran::parser::SyncImagesStmt const>, Fortran::common::Reference<Fortran::parser::SyncMemoryStmt const>, Fortran::common::Reference<Fortran::parser::SyncTeamStmt const>, Fortran::common::Reference<Fortran::parser::UnlockStmt const>, Fortran::common::Reference<Fortran::parser::WaitStmt const>, Fortran::common::Reference<Fortran::parser::WhereStmt const>, Fortran::common::Reference<Fortran::parser::WriteStmt const>, Fortran::common::Reference<Fortran::parser::ComputedGotoStmt const>, Fortran::common::Reference<Fortran::parser::ForallStmt const>, Fortran::common::Reference<Fortran::parser::ArithmeticIfStmt const>, Fortran::common::Reference<Fortran::parser::AssignStmt const>, Fortran::common::Reference<Fortran::parser::AssignedGotoStmt const>, Fortran::common::Reference<Fortran::parser::PauseStmt const>, Fortran::common::Reference<Fortran::parser::EntryStmt const>, Fortran::common::Reference<Fortran::parser::FormatStmt const>, Fortran::common::Reference<Fortran::parser::AssociateStmt const>, Fortran::common::Reference<Fortran::parser::EndAssociateStmt const>, Fortran::common::Reference<Fortran::parser::BlockStmt const>, Fortran::common::Reference<Fortran::parser::EndBlockStmt const>, Fortran::common::Reference<Fortran::parser::SelectCaseStmt const>, Fortran::common::Reference<Fortran::parser::CaseStmt const>, Fortran::common::Reference<Fortran::parser::EndSelectStmt const>, Fortran::common::Reference<Fortran::parser::ChangeTeamStmt const>, Fortran::common::Reference<Fortran::parser::EndChangeTeamStmt const>, Fortran::common::Reference<Fortran::parser::CriticalStmt const>, Fortran::common::Reference<Fortran::parser::EndCriticalStmt const>, Fortran::common::Reference<Fortran::parser::NonLabelDoStmt const>, Fortran::common::Reference<Fortran::parser::EndDoStmt const>, Fortran::common::Reference<Fortran::parser::IfThenStmt const>, Fortran::common::Reference<Fortran::parser::ElseIfStmt const>, Fortran::common::Reference<Fortran::parser::ElseStmt const>, Fortran::common::Reference<Fortran::parser::EndIfStmt const>, Fortran::common::Reference<Fortran::parser::SelectRankStmt const>, Fortran::common::Reference<Fortran::parser::SelectRankCaseStmt const>, Fortran::common::Reference<Fortran::parser::SelectTypeStmt const>, Fortran::common::Reference<Fortran::parser::TypeGuardStmt const>, Fortran::common::Reference<Fortran::parser::WhereConstructStmt const>, Fortran::common::Reference<Fortran::parser::MaskedElsewhereStmt const>, Fortran::common::Reference<Fortran::parser::ElsewhereStmt const>, Fortran::common::Reference<Fortran::parser::EndWhereStmt const>, Fortran::common::Reference<Fortran::parser::ForallConstructStmt const>, Fortran::common::Reference<Fortran::parser::EndForallStmt const>, Fortran::common::Reference<Fortran::parser::EndProgramStmt const>, Fortran::common::Reference<Fortran::parser::EndFunctionStmt const>, Fortran::common::Reference<Fortran::parser::EndSubroutineStmt const>, Fortran::common::Reference<Fortran::parser::EndMpSubprogramStmt const>, Fortran::common::Reference<Fortran::parser::AssociateConstruct const>, Fortran::common::Reference<Fortran::parser::BlockConstruct const>, Fortran::common::Reference<Fortran::parser::CaseConstruct const>, Fortran::common::Reference<Fortran::parser::ChangeTeamConstruct const>, Fortran::common::Reference<Fortran::parser::CriticalConstruct const>, Fortran::common::Reference<Fortran::parser::DoConstruct const>, Fortran::common::Reference<Fortran::parser::IfConstruct const>, Fortran::common::Reference<Fortran::parser::SelectRankConstruct const>, Fortran::common::Reference<Fortran::parser::SelectTypeConstruct const>, Fortran::common::Reference<Fortran::parser::WhereConstruct const>, Fortran::common::Reference<Fortran::parser::ForallConstruct const>, Fortran::common::Reference<Fortran::parser::CompilerDirective const>, Fortran::common::Reference<Fortran::parser::OpenACCConstruct const>, Fortran::common::Reference<Fortran::parser::OpenACCRoutineConstruct const>, Fortran::common::Reference<Fortran::parser::OpenACCDeclarativeConstruct const>, Fortran::common::Reference<Fortran::parser::OpenMPConstruct const>, Fortran::common::Reference<Fortran::parser::OpenMPDeclarativeConstruct const>, Fortran::common::Reference<Fortran::parser::OmpEndLoopDirective const>, Fortran::common::Reference<Fortran::parser::CUFKernelDoConstruct const>> const&>, std::integer_sequence<unsigned long, 90ul>>::__visit_invoke(Fortran::common::visitors<auto Fortran::lower::pft::ReferenceVariantBase<true, Fortran::parser::AllocateStmt, Fortran::parser::AssignmentStmt, Fortran::parser::BackspaceStmt, Fortran::parser::CallStmt, Fortran::parser::CloseStmt, Fortran::parser::ContinueStmt, Fortran::parser::CycleStmt, Fortran::parser::DeallocateStmt, Fortran::parser::EndfileStmt, Fortran::parser::EventPostStmt, Fortran::parser::EventWaitStmt, Fortran::parser::ExitStmt, Fortran::parser::FailImageStmt, Fortran::parser::FlushStmt, Fortran::parser::FormTeamStmt, Fortran::parser::GotoStmt, Fortran::parser::IfStmt, Fortran::parser::InquireStmt, Fortran::parser::LockStmt, Fortran::parser::NotifyWaitStmt, Fortran::parser::NullifyStmt, Fortran::parser::OpenStmt, Fortran::parser::PointerAssignmentStmt, Fortran::parser::PrintStmt, Fortran::parser::ReadStmt, Fortran::parser::ReturnStmt, Fortran::parser::RewindStmt, Fortran::parser::StopStmt, Fortran::parser::SyncAllStmt, Fortran::parser::SyncImagesStmt, Fortran::parser::SyncMemoryStmt, Fortran::parser::SyncTeamStmt, Fortran::parser::UnlockStmt, Fortran::parser::WaitStmt, Fortran::parser::WhereStmt, Fortran::parser::WriteStmt, Fortran::parser::ComputedGotoStmt, Fortran::parser::ForallStmt, Fortran::parser::ArithmeticIfStmt, Fortran::parser::AssignStmt, Fortran::parser::AssignedGotoStmt, Fortran::parser::PauseStmt, Fortran::parser::EntryStmt, Fortran::parser::FormatStmt, Fortran::parser::AssociateStmt, Fortran::parser::EndAssociateStmt, Fortran::parser::BlockStmt, Fortran::parser::EndBlockStmt, Fortran::parser::SelectCaseStmt, Fortran::parser::CaseStmt, Fortran::parser::EndSelectStmt, Fortran::parser::ChangeTeamStmt, Fortran::parser::EndChangeTeamStmt, Fortran::parser::CriticalStmt, Fortran::parser::EndCriticalStmt, Fortran::parser::NonLabelDoStmt, Fortran::parser::EndDoStmt, Fortran::parser::IfThenStmt, Fortran::parser::ElseIfStmt, Fortran::parser::ElseStmt, Fortran::parser::EndIfStmt, Fortran::parser::SelectRankStmt, Fortran::parser::SelectRankCaseStmt, Fortran::parser::SelectTypeStmt, Fortran::parser::TypeGuardStmt, Fortran::parser::WhereConstructStmt, Fortran::parser::MaskedElsewhereStmt, Fortran::parser::ElsewhereStmt, Fortran::parser::EndWhereStmt, Fortran::parser::ForallConstructStmt, Fortran::parser::EndForallStmt, Fortran::parser::EndProgramStmt, Fortran::parser::EndFunctionStmt, Fortran::parser::EndSubroutineStmt, Fortran::parser::EndMpSubprogramStmt, Fortran::parser::AssociateConstruct, Fortran::parser::BlockConstruct, Fortran::parser::CaseConstruct, Fortran::parser::ChangeTeamConstruct, Fortran::parser::CriticalConstruct, Fortran::parser::DoConstruct, Fortran::parser::IfConstruct, Fortran::parser::SelectRankConstruct, Fortran::parser::SelectTypeConstruct, Fortran::parser::WhereConstruct, Fortran::parser::ForallConstruct, Fortran::parser::CompilerDirective, Fortran::parser::OpenACCConstruct, Fortran::parser::OpenACCRoutineConstruct, Fortran::parser::OpenACCDeclarativeConstruct, Fortran::parser::OpenMPConstruct, Fortran::parser::OpenMPDeclarativeConstruct, Fortran::parser::OmpEndLoopDirective, Fortran::parser::CUFKernelDoConstruct>::visit<(anonymous namespace)::FirConverter::genFIR(Fortran::lower::pft::Evaluation&, bool)::'lambda'(auto const&)>(auto&&) const::'lambda'(auto)>&&, std::variant<Fortran::common::Reference<Fortran::parser::AllocateStmt const>, Fortran::common::Reference<Fortran::parser::AssignmentStmt const>, Fortran::common::Reference<Fortran::parser::BackspaceStmt const>, Fortran::common::Reference<Fortran::parser::CallStmt const>, Fortran::common::Reference<Fortran::parser::CloseStmt const>, Fortran::common::Reference<Fortran::parser::ContinueStmt const>, Fortran::common::Reference<Fortran::parser::CycleStmt const>, Fortran::common::Reference<Fortran::parser::DeallocateStmt const>, Fortran::common::Reference<Fortran::parser::EndfileStmt const>, Fortran::common::Reference<Fortran::parser::EventPostStmt const>, Fortran::common::Reference<Fortran::parser::EventWaitStmt const>, Fortran::common::Reference<Fortran::parser::ExitStmt const>, Fortran::common::Reference<Fortran::parser::FailImageStmt const>, Fortran::common::Reference<Fortran::parser::FlushStmt const>, Fortran::common::Reference<Fortran::parser::FormTeamStmt const>, Fortran::common::Reference<Fortran::parser::GotoStmt const>, Fortran::common::Reference<Fortran::parser::IfStmt const>, Fortran::common::Reference<Fortran::parser::InquireStmt const>, Fortran::common::Reference<Fortran::parser::LockStmt const>, Fortran::common::Reference<Fortran::parser::NotifyWaitStmt const>, Fortran::common::Reference<Fortran::parser::NullifyStmt const>, Fortran::common::Reference<Fortran::parser::OpenStmt const>, Fortran::common::Reference<Fortran::parser::PointerAssignmentStmt const>, Fortran::common::Reference<Fortran::parser::PrintStmt const>, Fortran::common::Reference<Fortran::parser::ReadStmt const>, Fortran::common::Reference<Fortran::parser::ReturnStmt const>, Fortran::common::Reference<Fortran::parser::RewindStmt const>, Fortran::common::Reference<Fortran::parser::StopStmt const>, Fortran::common::Reference<Fortran::parser::SyncAllStmt const>, Fortran::common::Reference<Fortran::parser::SyncImagesStmt const>, Fortran::common::Reference<Fortran::parser::SyncMemoryStmt const>, Fortran::common::Reference<Fortran::parser::SyncTeamStmt const>, Fortran::common::Reference<Fortran::parser::UnlockStmt const>, Fortran::common::Reference<Fortran::parser::WaitStmt const>, Fortran::common::Reference<Fortran::parser::WhereStmt const>, Fortran::common::Reference<Fortran::parser::WriteStmt const>, Fortran::common::Reference<Fortran::parser::ComputedGotoStmt const>, Fortran::common::Reference<Fortran::parser::ForallStmt const>, Fortran::common::Reference<Fortran::parser::ArithmeticIfStmt const>, Fortran::common::Reference<Fortran::parser::AssignStmt const>, Fortran::common::Reference<Fortran::parser::AssignedGotoStmt const>, Fortran::common::Reference<Fortran::parser::PauseStmt const>, Fortran::common::Reference<Fortran::parser::EntryStmt const>, Fortran::common::Reference<Fortran::parser::FormatStmt const>, Fortran::common::Reference<Fortran::parser::AssociateStmt const>, Fortran::common::Reference<Fortran::parser::EndAssociateStmt const>, Fortran::common::Reference<Fortran::parser::BlockStmt const>, Fortran::common::Reference<Fortran::parser::EndBlockStmt const>, Fortran::common::Reference<Fortran::parser::SelectCaseStmt const>, Fortran::common::Reference<Fortran::parser::CaseStmt const>, Fortran::common::Reference<Fortran::parser::EndSelectStmt const>, Fortran::common::Reference<Fortran::parser::ChangeTeamStmt const>, Fortran::common::Reference<Fortran::parser::EndChangeTeamStmt const>, Fortran::common::Reference<Fortran::parser::CriticalStmt const>, Fortran::common::Reference<Fortran::parser::EndCriticalStmt const>, Fortran::common::Reference<Fortran::parser::NonLabelDoStmt const>, Fortran::common::Reference<Fortran::parser::EndDoStmt const>, Fortran::common::Reference<Fortran::parser::IfThenStmt const>, Fortran::common::Reference<Fortran::parser::ElseIfStmt const>, Fortran::common::Reference<Fortran::parser::ElseStmt const>, Fortran::common::Reference<Fortran::parser::EndIfStmt const>, Fortran::common::Reference<Fortran::parser::SelectRankStmt const>, Fortran::common::Reference<Fortran::parser::SelectRankCaseStmt const>, Fortran::common::Reference<Fortran::parser::SelectTypeStmt const>, Fortran::common::Reference<Fortran::parser::TypeGuardStmt const>, Fortran::common::Reference<Fortran::parser::WhereConstructStmt const>, Fortran::common::Reference<Fortran::parser::MaskedElsewhereStmt const>, Fortran::common::Reference<Fortran::parser::ElsewhereStmt const>, Fortran::common::Reference<Fortran::parser::EndWhereStmt const>, Fortran::common::Reference<Fortran::parser::ForallConstructStmt const>, Fortran::common::Reference<Fortran::parser::EndForallStmt const>, Fortran::common::Reference<Fortran::parser::EndProgramStmt const>, Fortran::common::Reference<Fortran::parser::EndFunctionStmt const>, Fortran::common::Reference<Fortran::parser::EndSubroutineStmt const>, Fortran::common::Reference<Fortran::parser::EndMpSubprogramStmt const>, Fortran::common::Reference<Fortran::parser::AssociateConstruct const>, Fortran::common::Reference<Fortran::parser::BlockConstruct const>, Fortran::common::Reference<Fortran::parser::CaseConstruct const>, Fortran::common::Reference<Fortran::parser::ChangeTeamConstruct const>, Fortran::common::Reference<Fortran::parser::CriticalConstruct const>, Fortran::common::Reference<Fortran::parser::DoConstruct const>, Fortran::common::Reference<Fortran::parser::IfConstruct const>, Fortran::common::Reference<Fortran::parser::SelectRankConstruct const>, Fortran::common::Reference<Fortran::parser::SelectTypeConstruct const>, Fortran::common::Reference<Fortran::parser::WhereConstruct const>, Fortran::common::Reference<Fortran::parser::ForallConstruct const>, Fortran::common::Reference<Fortran::parser::CompilerDirective const>, Fortran::common::Reference<Fortran::parser::OpenACCConstruct const>, Fortran::common::Reference<Fortran::parser::OpenACCRoutineConstruct const>, Fortran::common::Reference<Fortran::parser::OpenACCDeclarativeConstruct const>, Fortran::common::Reference<Fortran::parser::OpenMPConstruct const>, Fortran::common::Reference<Fortran::parser::OpenMPDeclarativeConstruct const>, Fortran::common::Reference<Fortran::parser::OmpEndLoopDirective const>, Fortran::common::Reference<Fortran::parser::CUFKernelDoConstruct const>> const&) Bridge.cpp:0:0
#13 0x0000000005949f04 (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#14 0x000000000592f704 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x592f704)
#15 0x00000000058c76d4 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x58c76d4)
#16 0x00000000057dd30c Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57dd30c)
#17 0x00000000057ce3b8 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57ce3b8)
#18 0x00000000057e1adc Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57e1adc)
#19 0x00000000057c6b90 fc1_main(llvm::ArrayRef<char const*>, char const*) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57c6b90)
#20 0x00000000057c65e8 main (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57c65e8)
#21 0x0000400021054384 __libc_start_main (/lib64/libc.so.6+0x24384)
#22 0x00000000057c4ab4 _start (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57c4ab4)
flang-20: error: unable to execute command: Aborted (core dumped)
flang-20: error: flang frontend command failed due to signal (use -v to see invocation)
flang version 20.0.0git (https://github.com/llvm/llvm-project.git c5492e3c65e40cdcab9771b692f9ad437c65aa04)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin
Build config: +assertions
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
flang-20: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
flang-20: note: diagnostic msg: /tmp/snfmm221_2322-362e87
flang-20: note: diagnostic msg: /tmp/snfmm221_2322-362e87.sh
flang-20: note: diagnostic msg:

********************
$
$ cat /tmp/snfmm221_2322-362e87
#line "./snfmm221_2322.f90" 1
      program main
      common /com/ i
      i=1
!$omp sections lastprivate(/com/)
      i=2
!$omp end sections
      write(6,*) "i = ", i
      end program main
$
$ cat /tmp/snfmm221_2322-362e87.sh
# Crash reproducer for clang version 20.0.0git (https://github.com/llvm/llvm-project.git c5492e3c65e40cdcab9771b692f9ad437c65aa04)
# Driver args: "-fopenmp" "snfmm221_2322.f90"
# Original command:  "/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" "-emit-obj" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-target-cpu" "generic" "-target-feature" "+outline-atomics" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-fopenmp" "-resource-dir" "/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/lib/clang/20" "-mframe-pointer=non-leaf" "-o" "/tmp/snfmm221_2322-c33173.o" "-x" "f95-cpp-input" "snfmm221_2322.f90"
 "/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" "-emit-obj" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-target-cpu" "generic" "-target-feature" "+outline-atomics" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-fopenmp" "-mframe-pointer=non-leaf" "-x" "f95-cpp-input" "snfmm221_2322-362e87"
$
$ gfortran -fopenmp snfmm221_2322.f90
snfmm221_2322.f90:4:28:

    4 | !$omp sections lastprivate(/com/)
      |                            1
Error: Syntax error in OpenMP variable list at (1)
snfmm221_2322.f90:6:18:

    6 | !$omp end sections
      |                  1
Error: Unexpected !$OMP END SECTIONS statement at (1)
$
$ export OMP_NUM_THREADS=2; ifx -qopenmp snfmm221_2322.f90; ./a.out
 i =            2
$
@EugeneZelenko EugeneZelenko added flang:ir crash Prefer [crash-on-valid] or [crash-on-invalid] labels Jan 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 6, 2025

@llvm/issue-subscribers-flang-ir

Author: None (ohno-fj)

``` Version of flang : 20.0.0(c5492e3)/AArch64 ```

When common block is specified in list of lastprivate clause in sections construct, a compilation terminates abnormally.
When firstprivate and private are used instead of lastprivate, the compilation succeeds.

The following are the test program, Flang, Gfortran and ifx compilation/execution result.

snfmm221_2322.f90:

program main
  common /com/ i
  i=1
!$omp sections lastprivate(/com/)
  i=2
!$omp end sections
  write(6,*) "i = ", i
end program main
$ flang -fopenmp snfmm221_2322.f90
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
flang: /work/groups/ssoft/compiler/llvm/src/llvm-main/flang/lib/Lower/Bridge.cpp:894: virtual void {anonymous}::FirConverter::copyHostAssociateVar(const Fortran::semantics::Symbol&amp;, mlir::OpBuilder::InsertPoint*): Assertion `sym.has&lt;Fortran::semantics::HostAssocDetails&gt;() &amp;&amp; "No host-association found"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +outline-atomics -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -fopenmp -resource-dir /work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/lib/clang/20 -mframe-pointer=non-leaf -o /tmp/snfmm221_2322-c33173.o -x f95-cpp-input snfmm221_2322.f90
 #<!-- -->0 0x000040001c2035d0 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/work/groups/ssoft/compiler/llvm/aarch64/main-latest/lib/libLLVM.so.20.0git+0x5a035d0)
 #<!-- -->1 0x000040001c201658 llvm::sys::RunSignalHandlers() (/work/groups/ssoft/compiler/llvm/aarch64/main-latest/lib/libLLVM.so.20.0git+0x5a01658)
 #<!-- -->2 0x000040001c2017b0 SignalHandler(int) Signals.cpp:0:0
 #<!-- -->3 0x00004000118607a0 (linux-vdso.so.1+0x7a0)
 #<!-- -->4 0x0000400021066274 raise (/lib64/libc.so.6+0x36274)
 #<!-- -->5 0x0000400021050a2c abort (/lib64/libc.so.6+0x20a2c)
 #<!-- -->6 0x000040002105fba0 __assert_fail_base (/lib64/libc.so.6+0x2fba0)
 #<!-- -->7 0x000040002105fc18 __assert_perror_fail (/lib64/libc.so.6+0x2fc18)
 #<!-- -->8 0x000000000592f228 (anonymous namespace)::FirConverter::copyHostAssociateVar(Fortran::semantics::Symbol const&amp;, mlir::OpBuilder::InsertPoint*) Bridge.cpp:0:0
 #<!-- -->9 0x0000000005cbb968 genSectionsOp(Fortran::lower::AbstractConverter&amp;, Fortran::lower::SymMap&amp;, Fortran::semantics::SemanticsContext&amp;, Fortran::lower::pft::Evaluation&amp;, mlir::Location, llvm::SmallVector&lt;tomp::DirectiveWithClauses&lt;Fortran::lower::omp::Clause&gt;, 0u&gt; const&amp;, tomp::DirectiveWithClauses&lt;Fortran::lower::omp::Clause&gt; const*, Fortran::parser::OmpSectionBlocks const&amp;) OpenMP.cpp:0:0
#<!-- -->10 0x0000000005cc35d8 std::__detail::__variant::__gen_vtable_impl&lt;std::__detail::__variant::_Multi_array&lt;void (*)(genOMP(Fortran::lower::AbstractConverter&amp;, Fortran::lower::SymMap&amp;, Fortran::semantics::SemanticsContext&amp;, Fortran::lower::pft::Evaluation&amp;, Fortran::parser::OpenMPConstruct const&amp;)::'lambda'(auto&amp;&amp;)&amp;&amp;, std::variant&lt;Fortran::parser::OpenMPStandaloneConstruct, Fortran::parser::OpenMPSectionsConstruct, Fortran::parser::OpenMPSectionConstruct, Fortran::parser::OpenMPLoopConstruct, Fortran::parser::OpenMPBlockConstruct, Fortran::parser::OpenMPAtomicConstruct, Fortran::parser::OpenMPDeclarativeAllocate, Fortran::parser::OpenMPErrorConstruct, Fortran::parser::OpenMPExecutableAllocate, Fortran::parser::OpenMPAllocatorsConstruct, Fortran::parser::OpenMPCriticalConstruct&gt; const&amp;)&gt;, std::tuple&lt;std::variant&lt;Fortran::parser::OpenMPStandaloneConstruct, Fortran::parser::OpenMPSectionsConstruct, Fortran::parser::OpenMPSectionConstruct, Fortran::parser::OpenMPLoopConstruct, Fortran::parser::OpenMPBlockConstruct, Fortran::parser::OpenMPAtomicConstruct, Fortran::parser::OpenMPDeclarativeAllocate, Fortran::parser::OpenMPErrorConstruct, Fortran::parser::OpenMPExecutableAllocate, Fortran::parser::OpenMPAllocatorsConstruct, Fortran::parser::OpenMPCriticalConstruct&gt; const&amp;&gt;, std::integer_sequence&lt;unsigned long, 1ul&gt;&gt;::__visit_invoke(genOMP(Fortran::lower::AbstractConverter&amp;, Fortran::lower::SymMap&amp;, Fortran::semantics::SemanticsContext&amp;, Fortran::lower::pft::Evaluation&amp;, Fortran::parser::OpenMPConstruct const&amp;)::'lambda'(auto&amp;&amp;)&amp;&amp;, std::variant&lt;Fortran::parser::OpenMPStandaloneConstruct, Fortran::parser::OpenMPSectionsConstruct, Fortran::parser::OpenMPSectionConstruct, Fortran::parser::OpenMPLoopConstruct, Fortran::parser::OpenMPBlockConstruct, Fortran::parser::OpenMPAtomicConstruct, Fortran::parser::OpenMPDeclarativeAllocate, Fortran::parser::OpenMPErrorConstruct, Fortran::parser::OpenMPExecutableAllocate, Fortran::parser::OpenMPAllocatorsConstruct, Fortran::parser::OpenMPCriticalConstruct&gt; const&amp;) OpenMP.cpp:0:0
#<!-- -->11 0x0000000005ca7904 Fortran::lower::genOpenMPConstruct(Fortran::lower::AbstractConverter&amp;, Fortran::lower::SymMap&amp;, Fortran::semantics::SemanticsContext&amp;, Fortran::lower::pft::Evaluation&amp;, Fortran::parser::OpenMPConstruct const&amp;) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x5ca7904)
#<!-- -->12 0x00000000058e6530 std::__detail::__variant::__gen_vtable_impl&lt;std::__detail::__variant::_Multi_array&lt;void (*)(Fortran::common::visitors&lt;auto Fortran::lower::pft::ReferenceVariantBase&lt;true, Fortran::parser::AllocateStmt, Fortran::parser::AssignmentStmt, Fortran::parser::BackspaceStmt, Fortran::parser::CallStmt, Fortran::parser::CloseStmt, Fortran::parser::ContinueStmt, Fortran::parser::CycleStmt, Fortran::parser::DeallocateStmt, Fortran::parser::EndfileStmt, Fortran::parser::EventPostStmt, Fortran::parser::EventWaitStmt, Fortran::parser::ExitStmt, Fortran::parser::FailImageStmt, Fortran::parser::FlushStmt, Fortran::parser::FormTeamStmt, Fortran::parser::GotoStmt, Fortran::parser::IfStmt, Fortran::parser::InquireStmt, Fortran::parser::LockStmt, Fortran::parser::NotifyWaitStmt, Fortran::parser::NullifyStmt, Fortran::parser::OpenStmt, Fortran::parser::PointerAssignmentStmt, Fortran::parser::PrintStmt, Fortran::parser::ReadStmt, Fortran::parser::ReturnStmt, Fortran::parser::RewindStmt, Fortran::parser::StopStmt, Fortran::parser::SyncAllStmt, Fortran::parser::SyncImagesStmt, Fortran::parser::SyncMemoryStmt, Fortran::parser::SyncTeamStmt, Fortran::parser::UnlockStmt, Fortran::parser::WaitStmt, Fortran::parser::WhereStmt, Fortran::parser::WriteStmt, Fortran::parser::ComputedGotoStmt, Fortran::parser::ForallStmt, Fortran::parser::ArithmeticIfStmt, Fortran::parser::AssignStmt, Fortran::parser::AssignedGotoStmt, Fortran::parser::PauseStmt, Fortran::parser::EntryStmt, Fortran::parser::FormatStmt, Fortran::parser::AssociateStmt, Fortran::parser::EndAssociateStmt, Fortran::parser::BlockStmt, Fortran::parser::EndBlockStmt, Fortran::parser::SelectCaseStmt, Fortran::parser::CaseStmt, Fortran::parser::EndSelectStmt, Fortran::parser::ChangeTeamStmt, Fortran::parser::EndChangeTeamStmt, Fortran::parser::CriticalStmt, Fortran::parser::EndCriticalStmt, Fortran::parser::NonLabelDoStmt, Fortran::parser::EndDoStmt, Fortran::parser::IfThenStmt, Fortran::parser::ElseIfStmt, Fortran::parser::ElseStmt, Fortran::parser::EndIfStmt, Fortran::parser::SelectRankStmt, Fortran::parser::SelectRankCaseStmt, Fortran::parser::SelectTypeStmt, Fortran::parser::TypeGuardStmt, Fortran::parser::WhereConstructStmt, Fortran::parser::MaskedElsewhereStmt, Fortran::parser::ElsewhereStmt, Fortran::parser::EndWhereStmt, Fortran::parser::ForallConstructStmt, Fortran::parser::EndForallStmt, Fortran::parser::EndProgramStmt, Fortran::parser::EndFunctionStmt, Fortran::parser::EndSubroutineStmt, Fortran::parser::EndMpSubprogramStmt, Fortran::parser::AssociateConstruct, Fortran::parser::BlockConstruct, Fortran::parser::CaseConstruct, Fortran::parser::ChangeTeamConstruct, Fortran::parser::CriticalConstruct, Fortran::parser::DoConstruct, Fortran::parser::IfConstruct, Fortran::parser::SelectRankConstruct, Fortran::parser::SelectTypeConstruct, Fortran::parser::WhereConstruct, Fortran::parser::ForallConstruct, Fortran::parser::CompilerDirective, Fortran::parser::OpenACCConstruct, Fortran::parser::OpenACCRoutineConstruct, Fortran::parser::OpenACCDeclarativeConstruct, Fortran::parser::OpenMPConstruct, Fortran::parser::OpenMPDeclarativeConstruct, Fortran::parser::OmpEndLoopDirective, Fortran::parser::CUFKernelDoConstruct&gt;::visit&lt;(anonymous namespace)::FirConverter::genFIR(Fortran::lower::pft::Evaluation&amp;, bool)::'lambda'(auto const&amp;)&gt;(auto&amp;&amp;) const::'lambda'(auto)&gt;&amp;&amp;, std::variant&lt;Fortran::common::Reference&lt;Fortran::parser::AllocateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignmentStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::BackspaceStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CloseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ContinueStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CycleStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::DeallocateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndfileStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EventPostStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EventWaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ExitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FailImageStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FlushStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FormTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::GotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::InquireStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::LockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NotifyWaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NullifyStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PointerAssignmentStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PrintStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ReadStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ReturnStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::RewindStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::StopStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncAllStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncImagesStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncMemoryStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::UnlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WriteStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ComputedGotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ArithmeticIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignedGotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PauseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EntryStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FormatStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssociateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndAssociateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::BlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndBlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectCaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndSelectStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ChangeTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndChangeTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CriticalStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndCriticalStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NonLabelDoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndDoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfThenStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElseIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankCaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectTypeStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::TypeGuardStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereConstructStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::MaskedElsewhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElsewhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndWhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallConstructStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndForallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndProgramStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndFunctionStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndSubroutineStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndMpSubprogramStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssociateConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::BlockConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CaseConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::ChangeTeamConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CriticalConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::DoConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectTypeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CompilerDirective const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCRoutineConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCDeclarativeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenMPConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenMPDeclarativeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OmpEndLoopDirective const&gt;, Fortran::common::Reference&lt;Fortran::parser::CUFKernelDoConstruct const&gt;&gt; const&amp;)&gt;, std::tuple&lt;std::variant&lt;Fortran::common::Reference&lt;Fortran::parser::AllocateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignmentStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::BackspaceStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CloseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ContinueStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CycleStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::DeallocateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndfileStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EventPostStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EventWaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ExitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FailImageStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FlushStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FormTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::GotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::InquireStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::LockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NotifyWaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NullifyStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PointerAssignmentStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PrintStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ReadStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ReturnStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::RewindStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::StopStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncAllStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncImagesStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncMemoryStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::UnlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WriteStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ComputedGotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ArithmeticIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignedGotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PauseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EntryStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FormatStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssociateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndAssociateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::BlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndBlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectCaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndSelectStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ChangeTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndChangeTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CriticalStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndCriticalStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NonLabelDoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndDoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfThenStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElseIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankCaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectTypeStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::TypeGuardStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereConstructStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::MaskedElsewhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElsewhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndWhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallConstructStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndForallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndProgramStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndFunctionStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndSubroutineStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndMpSubprogramStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssociateConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::BlockConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CaseConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::ChangeTeamConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CriticalConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::DoConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectTypeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CompilerDirective const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCRoutineConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCDeclarativeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenMPConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenMPDeclarativeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OmpEndLoopDirective const&gt;, Fortran::common::Reference&lt;Fortran::parser::CUFKernelDoConstruct const&gt;&gt; const&amp;&gt;, std::integer_sequence&lt;unsigned long, 90ul&gt;&gt;::__visit_invoke(Fortran::common::visitors&lt;auto Fortran::lower::pft::ReferenceVariantBase&lt;true, Fortran::parser::AllocateStmt, Fortran::parser::AssignmentStmt, Fortran::parser::BackspaceStmt, Fortran::parser::CallStmt, Fortran::parser::CloseStmt, Fortran::parser::ContinueStmt, Fortran::parser::CycleStmt, Fortran::parser::DeallocateStmt, Fortran::parser::EndfileStmt, Fortran::parser::EventPostStmt, Fortran::parser::EventWaitStmt, Fortran::parser::ExitStmt, Fortran::parser::FailImageStmt, Fortran::parser::FlushStmt, Fortran::parser::FormTeamStmt, Fortran::parser::GotoStmt, Fortran::parser::IfStmt, Fortran::parser::InquireStmt, Fortran::parser::LockStmt, Fortran::parser::NotifyWaitStmt, Fortran::parser::NullifyStmt, Fortran::parser::OpenStmt, Fortran::parser::PointerAssignmentStmt, Fortran::parser::PrintStmt, Fortran::parser::ReadStmt, Fortran::parser::ReturnStmt, Fortran::parser::RewindStmt, Fortran::parser::StopStmt, Fortran::parser::SyncAllStmt, Fortran::parser::SyncImagesStmt, Fortran::parser::SyncMemoryStmt, Fortran::parser::SyncTeamStmt, Fortran::parser::UnlockStmt, Fortran::parser::WaitStmt, Fortran::parser::WhereStmt, Fortran::parser::WriteStmt, Fortran::parser::ComputedGotoStmt, Fortran::parser::ForallStmt, Fortran::parser::ArithmeticIfStmt, Fortran::parser::AssignStmt, Fortran::parser::AssignedGotoStmt, Fortran::parser::PauseStmt, Fortran::parser::EntryStmt, Fortran::parser::FormatStmt, Fortran::parser::AssociateStmt, Fortran::parser::EndAssociateStmt, Fortran::parser::BlockStmt, Fortran::parser::EndBlockStmt, Fortran::parser::SelectCaseStmt, Fortran::parser::CaseStmt, Fortran::parser::EndSelectStmt, Fortran::parser::ChangeTeamStmt, Fortran::parser::EndChangeTeamStmt, Fortran::parser::CriticalStmt, Fortran::parser::EndCriticalStmt, Fortran::parser::NonLabelDoStmt, Fortran::parser::EndDoStmt, Fortran::parser::IfThenStmt, Fortran::parser::ElseIfStmt, Fortran::parser::ElseStmt, Fortran::parser::EndIfStmt, Fortran::parser::SelectRankStmt, Fortran::parser::SelectRankCaseStmt, Fortran::parser::SelectTypeStmt, Fortran::parser::TypeGuardStmt, Fortran::parser::WhereConstructStmt, Fortran::parser::MaskedElsewhereStmt, Fortran::parser::ElsewhereStmt, Fortran::parser::EndWhereStmt, Fortran::parser::ForallConstructStmt, Fortran::parser::EndForallStmt, Fortran::parser::EndProgramStmt, Fortran::parser::EndFunctionStmt, Fortran::parser::EndSubroutineStmt, Fortran::parser::EndMpSubprogramStmt, Fortran::parser::AssociateConstruct, Fortran::parser::BlockConstruct, Fortran::parser::CaseConstruct, Fortran::parser::ChangeTeamConstruct, Fortran::parser::CriticalConstruct, Fortran::parser::DoConstruct, Fortran::parser::IfConstruct, Fortran::parser::SelectRankConstruct, Fortran::parser::SelectTypeConstruct, Fortran::parser::WhereConstruct, Fortran::parser::ForallConstruct, Fortran::parser::CompilerDirective, Fortran::parser::OpenACCConstruct, Fortran::parser::OpenACCRoutineConstruct, Fortran::parser::OpenACCDeclarativeConstruct, Fortran::parser::OpenMPConstruct, Fortran::parser::OpenMPDeclarativeConstruct, Fortran::parser::OmpEndLoopDirective, Fortran::parser::CUFKernelDoConstruct&gt;::visit&lt;(anonymous namespace)::FirConverter::genFIR(Fortran::lower::pft::Evaluation&amp;, bool)::'lambda'(auto const&amp;)&gt;(auto&amp;&amp;) const::'lambda'(auto)&gt;&amp;&amp;, std::variant&lt;Fortran::common::Reference&lt;Fortran::parser::AllocateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignmentStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::BackspaceStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CloseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ContinueStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CycleStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::DeallocateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndfileStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EventPostStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EventWaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ExitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FailImageStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FlushStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FormTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::GotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::InquireStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::LockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NotifyWaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NullifyStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PointerAssignmentStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PrintStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ReadStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ReturnStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::RewindStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::StopStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncAllStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncImagesStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncMemoryStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SyncTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::UnlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WaitStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WriteStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ComputedGotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ArithmeticIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssignedGotoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::PauseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EntryStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::FormatStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssociateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndAssociateStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::BlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndBlockStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectCaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndSelectStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ChangeTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndChangeTeamStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::CriticalStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndCriticalStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::NonLabelDoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndDoStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfThenStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElseIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndIfStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankCaseStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectTypeStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::TypeGuardStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereConstructStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::MaskedElsewhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ElsewhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndWhereStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallConstructStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndForallStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndProgramStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndFunctionStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndSubroutineStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::EndMpSubprogramStmt const&gt;, Fortran::common::Reference&lt;Fortran::parser::AssociateConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::BlockConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CaseConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::ChangeTeamConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CriticalConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::DoConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::IfConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectRankConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::SelectTypeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::WhereConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::ForallConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::CompilerDirective const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCRoutineConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenACCDeclarativeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenMPConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OpenMPDeclarativeConstruct const&gt;, Fortran::common::Reference&lt;Fortran::parser::OmpEndLoopDirective const&gt;, Fortran::common::Reference&lt;Fortran::parser::CUFKernelDoConstruct const&gt;&gt; const&amp;) Bridge.cpp:0:0
#<!-- -->13 0x0000000005949f04 (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&amp;) Bridge.cpp:0:0
#<!-- -->14 0x000000000592f704 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&amp;, Fortran::semantics::SemanticsContext const&amp;) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x592f704)
#<!-- -->15 0x00000000058c76d4 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x58c76d4)
#<!-- -->16 0x00000000057dd30c Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&amp;, Fortran::frontend::FrontendInputFile const&amp;) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57dd30c)
#<!-- -->17 0x00000000057ce3b8 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&amp;) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57ce3b8)
#<!-- -->18 0x00000000057e1adc Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57e1adc)
#<!-- -->19 0x00000000057c6b90 fc1_main(llvm::ArrayRef&lt;char const*&gt;, char const*) (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57c6b90)
#<!-- -->20 0x00000000057c65e8 main (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57c65e8)
#<!-- -->21 0x0000400021054384 __libc_start_main (/lib64/libc.so.6+0x24384)
#<!-- -->22 0x00000000057c4ab4 _start (/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang+0x57c4ab4)
flang-20: error: unable to execute command: Aborted (core dumped)
flang-20: error: flang frontend command failed due to signal (use -v to see invocation)
flang version 20.0.0git (https://github.com/llvm/llvm-project.git c5492e3c65e40cdcab9771b692f9ad437c65aa04)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin
Build config: +assertions
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
flang-20: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
flang-20: note: diagnostic msg: /tmp/snfmm221_2322-362e87
flang-20: note: diagnostic msg: /tmp/snfmm221_2322-362e87.sh
flang-20: note: diagnostic msg:

********************
$
$ cat /tmp/snfmm221_2322-362e87
#line "./snfmm221_2322.f90" 1
      program main
      common /com/ i
      i=1
!$omp sections lastprivate(/com/)
      i=2
!$omp end sections
      write(6,*) "i = ", i
      end program main
$
$ cat /tmp/snfmm221_2322-362e87.sh
# Crash reproducer for clang version 20.0.0git (https://github.com/llvm/llvm-project.git c5492e3c65e40cdcab9771b692f9ad437c65aa04)
# Driver args: "-fopenmp" "snfmm221_2322.f90"
# Original command:  "/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" "-emit-obj" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-target-cpu" "generic" "-target-feature" "+outline-atomics" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-fopenmp" "-resource-dir" "/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/lib/clang/20" "-mframe-pointer=non-leaf" "-o" "/tmp/snfmm221_2322-c33173.o" "-x" "f95-cpp-input" "snfmm221_2322.f90"
 "/work/groups/ssoft/compiler/llvm/aarch64/main-20241223-c5492e3c65e4/bin/flang" "-fc1" "-triple" "aarch64-unknown-linux-gnu" "-emit-obj" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-target-cpu" "generic" "-target-feature" "+outline-atomics" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-fopenmp" "-mframe-pointer=non-leaf" "-x" "f95-cpp-input" "snfmm221_2322-362e87"
$
$ gfortran -fopenmp snfmm221_2322.f90
snfmm221_2322.f90:4:28:

    4 | !$omp sections lastprivate(/com/)
      |                            1
Error: Syntax error in OpenMP variable list at (1)
snfmm221_2322.f90:6:18:

    6 | !$omp end sections
      |                  1
Error: Unexpected !$OMP END SECTIONS statement at (1)
$
$ export OMP_NUM_THREADS=2; ifx -qopenmp snfmm221_2322.f90; ./a.out
 i =            2
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] flang:ir flang:openmp
Projects
Development

No branches or pull requests

3 participants