Skip to content

[flang] [OpenMP] flang-new crashes with "'scf.if' op expects region #0 to have 0 or 1 blocks" #62458

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

Closed
k-arrows opened this issue Apr 30, 2023 · 2 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] flang:ir openmp

Comments

@k-arrows
Copy link

k-arrows commented Apr 30, 2023

$ cat test.f90
program test
  implicit none
  integer :: x(3), i
  !$omp parallel do lastprivate(x)
  do i = 1, 10
    x = (/ i, i, i /)
  end do

  if (any(x /= (/ 10, 10, 10 /))) stop 1
end program

Error message:

$ flang-new -fopenmp test.f90
error: loc("./test.f90":1:1): 'scf.if' op expects region #0 to have 0 or 1 blocks
error: Lowering to LLVM IR failed
error: loc("./test.f90":1:1): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func

Stack dump:

 #0 0x0000559e595ec638 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
 #1 0x0000559e595ea5ae llvm::sys::RunSignalHandlers()
 #2 0x0000559e595ecf68 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fa34ea3e520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000559e5cb1e2b9 llvm::Module::setPICLevel(llvm::PICLevel::Level)
 #5 0x0000559e597f72a0 Fortran::frontend::CodeGenAction::generateLLVMIR()
 #6 0x0000559e597f9280 Fortran::frontend::CodeGenAction::executeAction()
 #7 0x0000559e59619c5c Fortran::frontend::FrontendAction::execute()
 #8 0x0000559e5960cdce Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&)
 #9 0x0000559e5961cfde Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*)
#10 0x0000559e5857df21 fc1_main(llvm::ArrayRef<char const*>, char const*)
#11 0x0000559e5857bf66 main
#12 0x00007fa34ea25d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#13 0x00007fa34ea25e40 call_init ./csu/../csu/libc-start.c:128:20
#14 0x00007fa34ea25e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#15 0x0000559e5857b995 _start
flang-new: error: unable to execute command: Segmentation fault
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 16.0.2 (https://github.com/llvm/llvm-project 18ddebe1a1a9bde349441631365f0472e9693520)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Program arguments:

flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -o /tmp/test-709e43.o -x f95-cpp-input test.f90
@EugeneZelenko EugeneZelenko added openmp flang:ir crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Apr 30, 2023
@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2023

@llvm/issue-subscribers-flang-ir

@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2023

@llvm/issue-subscribers-openmp

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 openmp
Projects
None yet
Development

No branches or pull requests

3 participants