Skip to content

[flang][OpenMP][omp2012] Type confusion in reduction clause and fortran intrinsic #67332

@NimishMishra

Description

@NimishMishra

A type confusion in reduction clause and intrinsic causes a symbol type error.

program sample
integer :: x,y,z
!$omp parallel do default(private) REDUCTION(MIN:z)
   do i = 1, 10
       x = x + MIN(y,x)
   enddo
!$omp end parallel do
end program sample

causes a crash with

error: loc("/home/nimish/sample.f90":4:46): symbol must have a type
LLVM ERROR: aborting
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: flang-new -fc1 -fopenmp -emit-fir sample.f90 -o -
#0 0x00007f3cb03f2990 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/nimish/community/llvm-project/install/bin/../lib/libLLVMSupport.so.18git+0x1d5990)
#1 0x00007f3cb03efd9f llvm::sys::RunSignalHandlers() (/home/nimish/community/llvm-project/install/bin/../lib/libLLVMSupport.so.18git+0x1d2d9f)
#2 0x00007f3cb03efef5 SignalHandler(int) Signals.cpp:0:0
#3 0x00007f3cafdfd520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f3cafe51a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007f3cafe51a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007f3cafe51a7c pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007f3cafdfd476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007f3cafde37f3 abort ./stdlib/abort.c:81:7
#9 0x00007f3cb0270d74 llvm::GlobPattern::create(llvm::StringRef, std::optional<unsigned long>) (.cold) GlobPattern.cpp:0:0
#10 0x00007f3cb030de4e (/home/nimish/community/llvm-project/install/bin/../lib/libLLVMSupport.so.18git+0xf0e4e)
#11 0x00007f3cace50491 fir::emitFatalError(mlir::Location, llvm::Twine const&, bool) (/home/nimish/community/llvm-project/install/bin/../lib/../lib/libFortranLower.so.18git+0x13f491)
#12 0x00007f3cad1a3a77 (anonymous namespace)::TypeBuilderImpl::genSymbolType(Fortran::semantics::Symbol const&, bool, bool) ConvertType.cpp:0:0
#13 0x00007f3cad1a4899 Fortran::lower::translateSymbolToFIRType(Fortran::lower::AbstractConverter&, Fortran::common::Reference<Fortran::semantics::Symbol const>) (/home/nimish/community/llvm-project/install/bin/../lib/../lib/libFortranLower.so.18git+0x493899)
#14 0x00007f3cacea8837 (anonymous namespace)::FirConverter::createHostAssociateVarClone(Fortran::semantics::Symbol const&) Bridge.cpp:0:0
#15 0x00007f3cad24ab5b DataSharingProcessor::cloneSymbol(Fortran::semantics::Symbol const*) (/home/nimish/community/llvm-project/install/bin/../lib/../lib/libFortranLower.so.18git+0x539b5b)
#16 0x00007f3cad24d6e0 DataSharingProcessor::defaultPrivatize() (/home/nimish/community/llvm-project/install/bin/../lib/../lib/libFortranLower.so.18git+0x53c6e0)
#17 0x00007f3cad25d3a0 DataSharingProcessor::processStep1() (/home/nimish/community/llvm-project/install/bin/../lib/../lib/libFortranLower.so.18git+0x54c3a0)
#18 0x00007f3cad260b73 genOMP(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Evaluation&, Fortran::parser::OpenMPLoopConstruct const&) OpenMP.cpp:0:0
#19 0x00007f3cad24cb52 Fortran::lower::genOpenMPConstruct(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Evaluation&, Fortran::parser::OpenMPConstruct const&) (/home/nimish/community/llvm-project/install/bin/../lib/../lib/libFortranLower.so.18git+0x53bb52)

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]flang:iropenmp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions