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] Assertion `(&MBB != &MBB.getParent()->front() || IgnoreMissingDefs) && "no reload in start block. Missing vreg def?"' failed. #121289

Open
k-arrows opened this issue Dec 29, 2024 · 2 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] flang:ir flang:openmp

Comments

@k-arrows
Copy link

k-arrows commented Dec 29, 2024

Reproducer:

integer :: x
!$omp parallel private (x)
!$omp task shared (x) depend(out: x)
!$omp end task
!$omp end parallel
end

Assertion failure:

llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:696: void (anonymous namespace)::RegAllocFastImpl::reloadAtBegin(llvm::MachineBasicBlock &): Assertion `(&MBB != &MBB.getParent()->front() || IgnoreMissingDefs) && "no reload in start block. Missing vreg def?"' failed.

Stack dump:

 #0 0x00007f6a73a167d7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
 #1 0x00007f6a73a1436e llvm::sys::RunSignalHandlers()
 #2 0x00007f6a73a16eaa SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f6a73347520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f6a7339b9fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f6a7339b9fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007f6a7339b9fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007f6a73347476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007f6a7332d7f3 abort ./stdlib/abort.c:81:7
 #9 0x00007f6a7332d71b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007f6a7333ee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00007f6a724b86ac (anonymous namespace)::RegAllocFastImpl::runOnMachineFunction(llvm::MachineFunction&) RegAllocFast.cpp:0:0
#12 0x00007f6a724c4a3a (anonymous namespace)::RegAllocFast::runOnMachineFunction(llvm::MachineFunction&) RegAllocFast.cpp:0:0
#13 0x00007f6a722d40c4 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
#14 0x00007f6a70c6196b llvm::FPPassManager::runOnFunction(llvm::Function&) 
#15 0x00007f6a70c698a1 llvm::FPPassManager::runOnModule(llvm::Module&) 
#16 0x00007f6a70c6237f llvm::legacy::PassManagerImpl::run(llvm::Module&) 
#17 0x00007f6a747f4b49 Fortran::frontend::CodeGenAction::executeAction() 
#18 0x00007f6a747e91ac Fortran::frontend::FrontendAction::execute() 
#19 0x00007f6a747cf0e2 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) 
#20 0x00007f6a7496737c Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) 
#21 0x0000558a1e9d3433 fc1_main(llvm::ArrayRef<char const*>, char const*) 
#22 0x0000558a1e9d197a main 
#23 0x00007f6a7332ed90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#24 0x00007f6a7332ee40 call_init ./csu/../csu/libc-start.c:128:20
#25 0x00007f6a7332ee40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#26 0x0000558a1e9d1495 _start 
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 cb1ad985b53c87b53974e37bba60129acb294f0d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
@github-actions github-actions bot added the flang Flang issues not falling into any other category label Dec 29, 2024
@k-arrows k-arrows changed the title [Flang][OpenMP] CodeGen/RegAllocFast.cpp:696: void (anonymous n[Flang][OpenMP] Assertion `(&MBB != &MBB.getParent()->front() || IgnoreMissingDefs) && "no reload in start block. Missing vreg def?"' failed. [Flang][OpenMP] CodeGen/[Flang][OpenMP] Assertion `(&MBB != &MBB.getParent()->front() || IgnoreMissingDefs) && "no reload in start block. Missing vreg def?"' failed. Dec 29, 2024
@k-arrows k-arrows changed the title [Flang][OpenMP] CodeGen/[Flang][OpenMP] Assertion `(&MBB != &MBB.getParent()->front() || IgnoreMissingDefs) && "no reload in start block. Missing vreg def?"' failed. [Flang][OpenMP] Assertion `(&MBB != &MBB.getParent()->front() || IgnoreMissingDefs) && "no reload in start block. Missing vreg def?"' failed. Dec 29, 2024
@k-arrows k-arrows added flang:openmp crash Prefer [crash-on-valid] or [crash-on-invalid] and removed flang Flang issues not falling into any other category labels Dec 29, 2024
@k-arrows
Copy link
Author

Specifying -O1 or higher as the optimization level leads to another assertion failure.

llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp:976: void (anonymous namespace)::Mapper::remapInstruction(llvm::Instruction *): Assertion `(Flags & RF_IgnoreMissingLocals) && "Referenced value not in value map!"' failed.

@llvmbot
Copy link
Member

llvmbot commented Dec 29, 2024

@llvm/issue-subscribers-flang-ir

Author: None (k-arrows)

Reproducer: ```f90 integer :: x !$omp parallel private (x) !$omp task shared (x) depend(out: x) !$omp end task !$omp end parallel end ```

Assertion failure:

llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp:696: void (anonymous namespace)::RegAllocFastImpl::reloadAtBegin(llvm::MachineBasicBlock &amp;): Assertion `(&amp;MBB != &amp;MBB.getParent()-&gt;front() || IgnoreMissingDefs) &amp;&amp; "no reload in start block. Missing vreg def?"' failed.

Stack dump:

 #<!-- -->0 0x00007f6a73a167d7 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int)
 #<!-- -->1 0x00007f6a73a1436e llvm::sys::RunSignalHandlers()
 #<!-- -->2 0x00007f6a73a16eaa SignalHandler(int) Signals.cpp:0:0
 #<!-- -->3 0x00007f6a73347520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #<!-- -->4 0x00007f6a7339b9fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #<!-- -->5 0x00007f6a7339b9fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #<!-- -->6 0x00007f6a7339b9fc pthread_kill ./nptl/pthread_kill.c:89:10
 #<!-- -->7 0x00007f6a73347476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #<!-- -->8 0x00007f6a7332d7f3 abort ./stdlib/abort.c:81:7
 #<!-- -->9 0x00007f6a7332d71b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#<!-- -->10 0x00007f6a7333ee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#<!-- -->11 0x00007f6a724b86ac (anonymous namespace)::RegAllocFastImpl::runOnMachineFunction(llvm::MachineFunction&amp;) RegAllocFast.cpp:0:0
#<!-- -->12 0x00007f6a724c4a3a (anonymous namespace)::RegAllocFast::runOnMachineFunction(llvm::MachineFunction&amp;) RegAllocFast.cpp:0:0
#<!-- -->13 0x00007f6a722d40c4 llvm::MachineFunctionPass::runOnFunction(llvm::Function&amp;)
#<!-- -->14 0x00007f6a70c6196b llvm::FPPassManager::runOnFunction(llvm::Function&amp;) 
#<!-- -->15 0x00007f6a70c698a1 llvm::FPPassManager::runOnModule(llvm::Module&amp;) 
#<!-- -->16 0x00007f6a70c6237f llvm::legacy::PassManagerImpl::run(llvm::Module&amp;) 
#<!-- -->17 0x00007f6a747f4b49 Fortran::frontend::CodeGenAction::executeAction() 
#<!-- -->18 0x00007f6a747e91ac Fortran::frontend::FrontendAction::execute() 
#<!-- -->19 0x00007f6a747cf0e2 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&amp;) 
#<!-- -->20 0x00007f6a7496737c Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) 
#<!-- -->21 0x0000558a1e9d3433 fc1_main(llvm::ArrayRef&lt;char const*&gt;, char const*) 
#<!-- -->22 0x0000558a1e9d197a main 
#<!-- -->23 0x00007f6a7332ed90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#<!-- -->24 0x00007f6a7332ee40 call_init ./csu/../csu/libc-start.c:128:20
#<!-- -->25 0x00007f6a7332ee40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#<!-- -->26 0x0000558a1e9d1495 _start 
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 cb1ad985b53c87b53974e37bba60129acb294f0d)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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

No branches or pull requests

3 participants