Skip to content

[flang][OpenMP] Crash with incorrect SIMD LINEAR #171007

@eugeneepshteyn

Description

@eugeneepshteyn

Reproducer (uses array in LINEAR):

implicit none
integer :: j, arr(2)
!$omp simd linear(arr)
do j=1,10
end do
end

With 315c904 x86_64-unknown-linux-gnu flang:

$ flang -fopenmp omp-test.f90 && ./a.out
unknown LLVM dialect type
UNREACHABLE executed at llvm-project/llvm/include/llvm/ADT/TypeSwitch.h:143!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /home/eepshteyn/compilers/flang-upstream/bin/flang -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -fopenmp -resource-dir /home/eepshteyn/compilers/flang-upstream/lib/clang/22 -mframe-pointer=all -o /tmp/omp-test-a26994.o -x f95 omp-test.f90
 #0 0x00005fa741793de1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm-project/llvm/lib/Support/Unix/Signals.inc:834:11
 #1 0x00005fa74179435b PrintStackTraceSignalHandler(void*) llvm-project/llvm/lib/Support/Unix/Signals.inc:916:1
 #2 0x00005fa741792076 llvm::sys::RunSignalHandlers() llvm-project/llvm/lib/Support/Signals.cpp:104:5
 #3 0x00005fa741794add SignalHandler(int, siginfo_t*, void*) llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x0000754042c45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x0000754042c9eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x0000754042c9eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x0000754042c9eb2c pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x0000754042c4527e raise ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x0000754042c288ff abort ./stdlib/abort.c:81:7
#10 0x00005fa7416de670 llvm::install_out_of_memory_new_handler() llvm-project/llvm/lib/Support/ErrorHandling.cpp:225:0
#11 0x00005fa749b430a9 (/home/eepshteyn/compilers/flang-upstream/bin/flang+0x184280a9)
#12 0x00005fa749b427bf mlir::LLVM::detail::TypeToLLVMIRTranslatorImpl::translateType(mlir::Type) llvm-project/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp:77:14
#13 0x00005fa749b4235d mlir::LLVM::TypeToLLVMIRTranslator::translateType(mlir::Type) llvm-project/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp:187:3
#14 0x00005fa749aea58c mlir::LLVM::ModuleTranslation::convertType(mlir::Type) llvm-project/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:2257:3
#15 0x00005fa7466821d1 (anonymous namespace)::LinearClauseProcessor::registerType(mlir::LLVM::ModuleTranslation&, mlir::Attribute&) llvm-project/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp:151:48
#16 0x00005fa7466851f9 convertOmpSimd(mlir::Operation&, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) llvm-project/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp:2950:40
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions