Closed mollybuild closed 1 year ago
@llvm/issue-subscribers-flang-frontend
Hey @mollybuild , thanks for flagging this up!
Would you be able to use flang-new
instead? You will have to replace -c
with -fsyntax-only
as code-generation is not supported yet. This should be fine for this particular bug as it's clearly failing during the semantic analysis.
Also, any chance you would be able to reduce this?
-Andrzej
Hey @mollybuild , thanks for flagging this up!
Would you be able to use
flang-new
instead? You will have to replace-c
with-fsyntax-only
as code-generation is not supported yet. This should be fine for this particular bug as it's clearly failing during the semantic analysis.Also, any chance you would be able to reduce this?
-Andrzej
Hi Andrzej,
I tried flang-new
with -fsyntax-only
. It shows this:
cxo@0191e105f0c0:~/benchmark/cpu2017_install/benchspec/CPU/627.cam4_s/build/build_base_clang14-riscv64-64.0000$ /home/cxo/llvm-bin/bin/flang-new -fsyntax-only -I. -Iinclude -Inetcdf/include -fopenmp m_ExchangeMaps.fppized.f90
fatal internal error: node has not been analyzed:
Expr -> FunctionReference -> Call
| ProcedureDesignator -> Name = 'globalmap_comp_id'
| ActualArgSpec
| | ActualArg -> Expr -> Designator -> DataRef -> Name = 'gmap'
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/cxo/llvm-bin/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -I . -I include -I netcdf/include -fopenmp m_ExchangeMaps.fppized.f90
#0 0x0000000000c4ebb3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/cxo/llvm-bin/bin/flang-new+0xc4ebb3)
#1 0x0000000000c4c8ee llvm::sys::RunSignalHandlers() (/home/cxo/llvm-bin/bin/flang-new+0xc4c8ee)
#2 0x0000000000c4f1af SignalHandler(int) Signals.cpp:0:0
#3 0x00007fc8a52c33c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
#4 0x00007fc8a4d5603b raise /build/glibc-sMfBJT/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007fc8a4d35859 abort /build/glibc-sMfBJT/glibc-2.31/stdlib/abort.c:81:7
#6 0x0000000001d11136 (/home/cxo/llvm-bin/bin/flang-new+0x1d11136)
#7 0x000000000118c829 (/home/cxo/llvm-bin/bin/flang-new+0x118c829)
#8 0x0000000001453e49 Fortran::semantics::OmpAttributeVisitor::Pre(Fortran::parser::StmtFunctionStmt const&) (/home/cxo/llvm-bin/bin/flang-new+0x1453e49)
#9 0x0000000001453789 Fortran::semantics::OmpAttributeVisitor std::__invoke_impl<void, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery>(std::variant<Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery> const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> > const&>(std::__invoke_other, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery>(std::variant<Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery> const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)&&, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> > const&) (/home/cxo/llvm-bin/bin/flang-new+0x1453789)
#10 0x0000000001441abb void Fortran::parser::ForEachInTuple<4ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x1441abb)
#11 0x0000000001441927 void Fortran::parser::ForEachInTuple<2ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x1441927)
#12 0x000000000143d114 std::enable_if<TupleTrait<Fortran::parser::SpecificationPart>, void>::type Fortran::parser::Walk<Fortran::parser::SpecificationPart, Fortran::semantics::OmpAttributeVisitor>(Fortran::parser::SpecificationPart const&, Fortran::semantics::OmpAttributeVisitor&) (/home/cxo/llvm-bin/bin/flang-new+0x143d114)
#13 0x0000000001467d20 void Fortran::parser::ForEachInTuple<1ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > >(std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x1467d20)
#14 0x00000000014685fb void Fortran::parser::ForEachInTuple<0ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > >(std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x14685fb)
#15 0x000000000142a0f6 Fortran::semantics::ResolveOmpParts(Fortran::semantics::SemanticsContext&, Fortran::parser::ProgramUnit const&) (/home/cxo/llvm-bin/bin/flang-new+0x142a0f6)
#16 0x00000000013d7175 Fortran::semantics::ResolveNamesVisitor::Pre(Fortran::parser::ProgramUnit const&) (/home/cxo/llvm-bin/bin/flang-new+0x13d7175)
#17 0x00000000013d7e78 Fortran::semantics::ResolveNames(Fortran::semantics::SemanticsContext&, Fortran::parser::Program const&, Fortran::semantics::Scope&) (/home/cxo/llvm-bin/bin/flang-new+0x13d7e78)
#18 0x000000000116a7ba Fortran::semantics::Semantics::Perform() (/home/cxo/llvm-bin/bin/flang-new+0x116a7ba)
#19 0x0000000000c99977 Fortran::frontend::FrontendAction::RunSemanticChecks() (/home/cxo/llvm-bin/bin/flang-new+0xc99977)
#20 0x0000000000e79821 Fortran::frontend::PrescanAndSemaAction::BeginSourceFileAction() (/home/cxo/llvm-bin/bin/flang-new+0xe79821)
#21 0x0000000000c98cf2 Fortran::frontend::FrontendAction::BeginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/home/cxo/llvm-bin/bin/flang-new+0xc98cf2)
#22 0x0000000000c8eb77 Fortran::frontend::CompilerInstance::ExecuteAction(Fortran::frontend::FrontendAction&) (/home/cxo/llvm-bin/bin/flang-new+0xc8eb77)
#23 0x0000000000c9ccb0 Fortran::frontend::ExecuteCompilerInvocation(Fortran::frontend::CompilerInstance*) (/home/cxo/llvm-bin/bin/flang-new+0xc9ccb0)
#24 0x0000000000bd17f6 fc1_main(llvm::ArrayRef<char const*>, char const*) (/home/cxo/llvm-bin/bin/flang-new+0xbd17f6)
#25 0x0000000000bd0422 main (/home/cxo/llvm-bin/bin/flang-new+0xbd0422)
#26 0x00007fc8a4d370b3 __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:342:3
#27 0x0000000000bd00ce _start (/home/cxo/llvm-bin/bin/flang-new+0xbd00ce)
flang-new: error: unable to execute command: Aborted (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 15.0.0 (https://github.com/llvm/llvm-project 61e1581fa3f888a5a0800cdbdd19a45fc60d1435)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cxo/llvm-bin/bin
flang-new: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
flang-new: note: diagnostic msg: /tmp/m_ExchangeMaps-b6565a
flang-new: note: diagnostic msg: /tmp/m_ExchangeMaps-b6565a.sh
flang-new: note: diagnostic msg:
********************
Sorry, I'm not sure what does "any chance you would be able to reduce this?" mean. Would you explain more?
Sorry, I'm not sure what does "any chance you would be able to reduce this?" mean. Would you explain more?
As in, reduce to a smaller reproducer :) Currently, "m_ExchangeMaps.fppized.f90" is 610 lines of code and it is hard to tell what the actual issue is.
Hi Andrzej,
I found that this bug is caused by two factors: constant array index, and -fopenmp
option. If the code contains constant array index, and compile with -fopenmp
, it will encounter this error. Like the code bellow:
file m_ExchangeMaps.test.f90
module m_ExchangeMaps
implicit none
private ! except
integer, parameter :: MapTypeIndex = 2
contains
subroutine LoadGlobalMapPars_(MapPars)
implicit none
!
! !OUTPUT PARAMETERS:
!
integer, intent(out) :: MapPars(4)
MapPars(MapTypeIndex) = 1
! MapPars(2) = 1
end subroutine LoadGlobalMapPars_
end module m_ExchangeMaps
compile with:
$ flang-new -fsyntax-only -o m_ExchangeMaps.test.o -fopenmp m_ExchangeMaps.test.f90
will report error:
cxo@0191e105f0c0:~/benchmark/cpu2017_install/benchspec/CPU/627.cam4_s/build/build_base_clang14-riscv64-64.0000$ /home/cxo/llvm-bin/bin/flang-new -fsyntax-only -o m_ExchangeMaps.test.o -fopenmp m_ExchangeMaps.test.f90
fatal internal error: node has not been analyzed:
Expr -> LiteralConstant -> IntLiteralConstant = '1'
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/cxo/llvm-bin/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -fopenmp m_ExchangeMaps.test.f90
#0 0x0000000000c4ebb3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/cxo/llvm-bin/bin/flang-new+0xc4ebb3)
#1 0x0000000000c4c8ee llvm::sys::RunSignalHandlers() (/home/cxo/llvm-bin/bin/flang-new+0xc4c8ee)
#2 0x0000000000c4f1af SignalHandler(int) Signals.cpp:0:0
#3 0x00007f14322f43c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
#4 0x00007f1431d8703b raise /build/glibc-sMfBJT/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f1431d66859 abort /build/glibc-sMfBJT/glibc-2.31/stdlib/abort.c:81:7
#6 0x0000000001d11136 (/home/cxo/llvm-bin/bin/flang-new+0x1d11136)
#7 0x000000000118c829 (/home/cxo/llvm-bin/bin/flang-new+0x118c829)
#8 0x0000000001453e49 Fortran::semantics::OmpAttributeVisitor::Pre(Fortran::parser::StmtFunctionStmt const&) (/home/cxo/llvm-bin/bin/flang-new+0x1453e49)
#9 0x0000000001453789 Fortran::semantics::OmpAttributeVisitor std::__invoke_impl<void, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery>(std::variant<Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery> const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> > const&>(std::__invoke_other, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery>(std::variant<Fortran::parser::SpecificationConstruct, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::DataStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::FormatStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::EntryStmt, false> >, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> >, Fortran::parser::ErrorRecovery> const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)&&, Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::StmtFunctionStmt, false> > const&) (/home/cxo/llvm-bin/bin/flang-new+0x1453789)
#10 0x0000000001441abb void Fortran::parser::ForEachInTuple<4ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x1441abb)
#11 0x0000000001441927 void Fortran::parser::ForEachInTuple<2ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > >(std::tuple<std::__cxx11::list<Fortran::parser::OpenACCDeclarativeConstruct, std::allocator<Fortran::parser::OpenACCDeclarativeConstruct> >, std::__cxx11::list<Fortran::parser::OpenMPDeclarativeConstruct, std::allocator<Fortran::parser::OpenMPDeclarativeConstruct> >, std::__cxx11::list<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false>, std::allocator<Fortran::common::Indirection<Fortran::parser::CompilerDirective, false> > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::UseStmt, false> > > >, std::__cxx11::list<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> >, std::allocator<Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ImportStmt, false> > > >, Fortran::parser::ImplicitPart, std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct> > > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x1441927)
#12 0x000000000143d114 std::enable_if<TupleTrait<Fortran::parser::SpecificationPart>, void>::type Fortran::parser::Walk<Fortran::parser::SpecificationPart, Fortran::semantics::OmpAttributeVisitor>(Fortran::parser::SpecificationPart const&, Fortran::semantics::OmpAttributeVisitor&) (/home/cxo/llvm-bin/bin/flang-new+0x143d114)
#13 0x0000000001467d20 void Fortran::parser::ForEachInTuple<1ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > >(std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::SubroutineStmt>, Fortran::parser::SpecificationPart, Fortran::parser::ExecutionPart, std::optional<Fortran::parser::InternalSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndSubroutineStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x1467d20)
#14 0x00000000014685fb void Fortran::parser::ForEachInTuple<0ul, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&), std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > >(std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > const&, void Fortran::parser::Walk<Fortran::semantics::OmpAttributeVisitor, Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> >(std::tuple<Fortran::parser::Statement<Fortran::parser::ModuleStmt>, Fortran::parser::SpecificationPart, std::optional<Fortran::parser::ModuleSubprogramPart>, Fortran::parser::Statement<Fortran::parser::EndModuleStmt> > const&, Fortran::semantics::OmpAttributeVisitor&)::'lambda'(Fortran::semantics::OmpAttributeVisitor const&)) (/home/cxo/llvm-bin/bin/flang-new+0x14685fb)
#15 0x000000000142a0f6 Fortran::semantics::ResolveOmpParts(Fortran::semantics::SemanticsContext&, Fortran::parser::ProgramUnit const&) (/home/cxo/llvm-bin/bin/flang-new+0x142a0f6)
#16 0x00000000013d7175 Fortran::semantics::ResolveNamesVisitor::Pre(Fortran::parser::ProgramUnit const&) (/home/cxo/llvm-bin/bin/flang-new+0x13d7175)
#17 0x00000000013d7e78 Fortran::semantics::ResolveNames(Fortran::semantics::SemanticsContext&, Fortran::parser::Program const&, Fortran::semantics::Scope&) (/home/cxo/llvm-bin/bin/flang-new+0x13d7e78)
#18 0x000000000116a7ba Fortran::semantics::Semantics::Perform() (/home/cxo/llvm-bin/bin/flang-new+0x116a7ba)
#19 0x0000000000c99977 Fortran::frontend::FrontendAction::RunSemanticChecks() (/home/cxo/llvm-bin/bin/flang-new+0xc99977)
#20 0x0000000000e79821 Fortran::frontend::PrescanAndSemaAction::BeginSourceFileAction() (/home/cxo/llvm-bin/bin/flang-new+0xe79821)
#21 0x0000000000c98cf2 Fortran::frontend::FrontendAction::BeginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/home/cxo/llvm-bin/bin/flang-new+0xc98cf2)
#22 0x0000000000c8eb77 Fortran::frontend::CompilerInstance::ExecuteAction(Fortran::frontend::FrontendAction&) (/home/cxo/llvm-bin/bin/flang-new+0xc8eb77)
#23 0x0000000000c9ccb0 Fortran::frontend::ExecuteCompilerInvocation(Fortran::frontend::CompilerInstance*) (/home/cxo/llvm-bin/bin/flang-new+0xc9ccb0)
#24 0x0000000000bd17f6 fc1_main(llvm::ArrayRef<char const*>, char const*) (/home/cxo/llvm-bin/bin/flang-new+0xbd17f6)
#25 0x0000000000bd0422 main (/home/cxo/llvm-bin/bin/flang-new+0xbd0422)
#26 0x00007f1431d680b3 __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:342:3
#27 0x0000000000bd00ce _start (/home/cxo/llvm-bin/bin/flang-new+0xbd00ce)
flang-new: error: unable to execute command: Aborted (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 15.0.0 (https://github.com/llvm/llvm-project 61e1581fa3f888a5a0800cdbdd19a45fc60d1435)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cxo/llvm-bin/bin
flang-new: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
flang-new: note: diagnostic msg: /tmp/m_ExchangeMaps-be27e9
flang-new: note: diagnostic msg: /tmp/m_ExchangeMaps-be27e9.sh
flang-new: note: diagnostic msg:
********************
If I discard -fopenmp
option or replace MapTypeIndex
with its value, it will get through.
Fantastic effort, thank you @mollybuild ! So this is clearly a bug in the OpenMP semantic checks.
@kiranchandramohan or @Leporacanthicus , would you be able to take a look? I know that both are away this week, so bear with us @mollybuild :)
@llvm/issue-subscribers-openmp
Hi,
I tested and confirm that the failure due to openmp has been fixed by https://reviews.llvm.org/D122650. But there is another semantic analysis issue. The error report is:
error: Semantic errors in seq_flds_mod.F90
./seq_flds_mod.F90:27:25: error: Actual argument type 'mct_string' is not compatible with dummy argument type 'list'
call mct_string_clean(mctOStr)
^^^^^^^
There are two clean functions defined in file m_String.F90 and m_List.F90, so some kind of mix up happened. It doesn't recognize the right one.
I put the reduced code here:
https://github.com/mollybuild/RISCV-Measurement/tree/master/issue-627
Just run with make all
will see the error message.
Thanks, Molly
Thanks @mollybuild. We are working through spec2017 to fix the various issues. I did see the issue myself yesterday with pop2_s
.
We will get to fixing this sometime in the next few months.
The following ticket captures the high-level details with spec2017. We will be adding more details about the failures, creating separate tickets for issues etc. https://github.com/flang-compiler/f18-llvm-project/issues/1476
Hi,
I tested and confirm that the failure due to openmp has been fixed by https://reviews.llvm.org/D122650. But there is another semantic analysis issue. The error report is:
We may close this issue in that case if 627.cam4_s compiles fine.
OK. The semantics issues are fixed. Issue in OpenMP lowering is tracked in https://github.com/llvm/llvm-project/issues/58378.
error information:
Host: RISCV64 board Flang build from llvm-project source code: branch main, commit 7fd60ee Building Flang configured with:
See m_ExchangeMaps.fppized.f90 in : https://github.com/mollybuild/RISCV-Measurement/blob/master/issues/m_ExchangeMaps.fppized.f90