llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.77k stars 11.89k forks source link

lli or llc debug assert appeared #16562

Open llvmbot opened 11 years ago

llvmbot commented 11 years ago
Bugzilla Link 16188
Version 3.2
OS Windows NT
Attachments sample file
Reporter LLVM Bugzilla Contributor

Extended Description

I'm trying to create simple program using LLVM IR with exception handling. I can't find proper documentation for step by step explantion. I've created sample on the basis of: http://llvm.org/docs/LangRef.html http://llvm.org/devmtg/2011-09-16/EuroLLVM2011-ExceptionHandling.pdf

but during compilation assert message appeared:

SelectionDAGBuilder shouldn't visit resume instructions! UNREACHABLE executed at ........\lib\CodeGen\SelectionDAG\SelectionDAGBuilder .cpp:1885!

Sample file attached.

llvmbot commented 11 years ago

Maybe exception handling isn't supported on Windows (not sure).

llvmbot commented 11 years ago

I've tested on latest version LLVM version 3.4svn DEBUG build with assertions. Built May 31 2013 (17:59:16). Default target: i686-pc-win32 Host CPU: corei7-avx

The same issue with slightly different behaviour

d:\Alexander\Temp\2>llc test.bc SelectionDAGBuilder shouldn't visit resume instructions! UNREACHABLE executed at ........\lib\CodeGen\SelectionDAG\SelectionDAGBuilder .cpp:1885! Stack dump:

  1. Program arguments: llc test.bc
  2. Running pass 'Function Pass Manager' on module 'test.bc'.
  3. Running pass 'X86 DAG->DAG Instruction Selection' on function '@Test' 0x0F8389EB (0x0000000A 0x00000000 0x00CBEFBC 0x01D61939), _get_pgmptr() + 0x21B bytes(s) 0x0F914F2E (0x00CBF19C 0x00CBEFD4 0x0152A1D2 0x025BF0A4), abort() + 0x1E bytes(s ) 0x01D61939 (0x025BF0A4 0x025C054C 0x0000075D 0x0020EF30), llvm::llvm_unreachable _internal() + 0x89 bytes(s), d:\alexander\temp\3\llvm\lib\support\errorhandling. cpp, line 98 + 0x8 byte(s) 0x0152A1D2 (0x001EF434 0x00000005 0x0020EF30 0x00CBF004), llvm::SelectionDAGBuil der::visitResume() + 0x22 bytes(s), d:\alexander\temp\3\llvm\lib\codegen\selecti ondag\selectiondagbuilder.cpp, line 1886 0x0152574B (0x00000006 0x001EF434 0xCCCCCCCC 0x001EF434), llvm::SelectionDAGBuil der::visit() + 0xAB bytes(s), d:\alexander\temp\3\llvm\include\llvm\ir\instructi on.def, line 102 + 0xC byte(s) 0x0152560A (0x001EF434 0xCCCCCCCC 0xCCCCCCCC 0xCCCCCCCC), llvm::SelectionDAGBuil der::visit() + 0x7A bytes(s), d:\alexander\temp\3\llvm\lib\codegen\selectiondag\ selectiondagbuilder.cpp, line 952 0x014B4118 (0x001EF3B0 0x001EB224 0x00CBF08F 0x00CBF374), llvm::SelectionDAGISel ::SelectBasicBlock() + 0x68 bytes(s), d:\alexander\temp\3\llvm\lib\codegen\selec tiondag\selectiondagisel.cpp, line 517 + 0x14 byte(s) 0x014B5E8D (0x001EF498 0x00CBF3F8 0x00CBF380 0x00000000), llvm::SelectionDAGISel ::SelectAllBasicBlocks() + 0x8DD bytes(s), d:\alexander\temp\3\llvm\lib\codegen\ selectiondag\selectiondagisel.cpp, line 1127 0x014B3605 (0x00243048 0x00CBF398 0x00243048 0x0020E800), llvm::SelectionDAGISel ::runOnMachineFunction() + 0x2D5 bytes(s), d:\alexander\temp\3\llvm\lib\codegen\ selectiondag\selectiondagisel.cpp, line 391 0x0177BCC0 (0x001EF498 0x00CBF4F0 0x00CBF434 0x00000001), llvm::MachineFunctionP ass::runOnFunction() + 0x50 bytes(s), d:\alexander\temp\3\llvm\lib\codegen\machi nefunctionpass.cpp, line 33 + 0x13 byte(s) 0x01B4D1F5 (0x001EF498 0x00000000 0xCCCCCCCC 0x001E9384), llvm::FPPassManager::r unOnFunction() + 0x105 bytes(s), d:\alexander\temp\3\llvm\lib\ir\passmanager.cpp , line 1530 + 0x17 byte(s) 0x01B4D385 (0x001E93B0 0x00CBF9AC 0x00CBF4FC 0x00000000), llvm::FPPassManager::r unOnModule() + 0x75 bytes(s), d:\alexander\temp\3\llvm\lib\ir\passmanager.cpp, l ine 1550 + 0x15 byte(s) 0x01B4D6C9 (0x001E93B0 0x00CBF540 0x7EFDE000 0xCCCCCCCC), llvm::MPPassManager::r unOnModule() + 0x1C9 bytes(s), d:\alexander\temp\3\llvm\lib\ir\passmanager.cpp, line 1608 + 0x17 byte(s) 0x01B4DCC3 (0x001E93B0 0x00CBF65C 0x00CBF9AC 0x00E15A72), llvm::PassManagerImpl: :run() + 0x103 bytes(s), d:\alexander\temp\3\llvm\lib\ir\passmanager.cpp, line 1 703 + 0x1B byte(s) 0x01B4DEBD (0x001E93B0 0x00CBF9FC 0x00000000 0xCCCCCCCC), llvm::PassManager::run () + 0x1D bytes(s), d:\alexander\temp\3\llvm\lib\ir\passmanager.cpp, line 1739 0x00E15A72 (0x001E7BB8 0x00328048 0x00000000 0xCCCCCCCC), compileModule() + 0x10 C2 bytes(s), d:\alexander\temp\3\llvm\tools\llc\llc.cpp, line 378 0x00E14927 (0x00000002 0x001E7BB8 0x00321FD0 0xF949C930), main() + 0xE7 bytes(s) , d:\alexander\temp\3\llvm\tools\llc\llc.cpp, line 195 + 0xD byte(s) 0x01DBAEFF (0x00CBFA60 0x74B033AA 0x7EFDE000 0x00CBFAA0), __tmainCRTStartup() + 0x1BF bytes(s), f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c, line 555 + 0x19 byte(s) 0x01DBAD2F (0x7EFDE000 0x00CBFAA0 0x77229EF2 0x7EFDE000), mainCRTStartup() + 0xF bytes(s), f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c, line 371 0x74B033AA (0x7EFDE000 0x449CAC3F 0x00000000 0x00000000), BaseThreadInitThunk()
    • 0x12 bytes(s) 0x77229EF2 (0x01DBAD20 0x7EFDE000 0x00000000 0x00000000), RtlInitializeException Chain() + 0x63 bytes(s) 0x77229EC5 (0x01DBAD20 0x7EFDE000 0x00000000 0x00000000), RtlInitializeException Chain() + 0x36 bytes(s)
llvmbot commented 11 years ago

Note that I'm using Linux. Can you please verify that LLVM 3.3 release candidate 3, or the LLVM development version, works for you on windows.

llvmbot commented 11 years ago

The new example passes the verifier. However it doesn't crash llc (latest development version) on my machine:

$ llc pr16188-2.bc $

llvmbot commented 11 years ago

Corrected sample

llvmbot commented 11 years ago

The bitcode is invalid:

$ opt -verify -disable-output pr16188.bc The unwind destination does not have a landingpad instruction! invoke void @​Test() to label %Continue unwind label %Continue Broken module found, compilation aborted!

If you build LLVM with assertions enabled then llc will tell you this:

$ llc pr16188.bc The unwind destination does not have a landingpad instruction! invoke void @​Test() to label %Continue unwind label %Continue Broken module found, compilation aborted!