<div dir="ltr">This looks like a problem in WinEHPrepare. Try disabling C++ exceptions. See this bug for more info:<div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D22975&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=8kq1lLn_WpoJFSr5tWI34A6loDzsnBz3C3FA9N-zrfQ&s=hBr_0GdzWtC3KYDP21CIlhpd1zmslo4_RocKg5wv5Ok&e=">https://llvm.org/bugs/show_bug.cgi?id=22975</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 1, 2015 at 3:13 AM, haifeng.qin <span dir="ltr"><<a href="mailto:haifeng.qin@wellintech.com" target="_blank">haifeng.qin@wellintech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
            <div>HI,</div><div><br></div><div><b>file</b>:  <span style="font-size:10.5pt;line-height:1.5;background-color:window">M:\OpenSource\LLVMTest\LLVMTest\main.cpp</span></div><div><span style="font-size:10.5pt;line-height:1.5;background-color:window"><b>code</b>:</span></div><div><span style="font-size:10.5pt;line-height:1.5;background-color:window"><br></span></div><div><span style="font-size:10.5pt;line-height:1.5;background-color:window">//#include <string></span></div><div>#include <iostream></div><div><br><br>int main(int argc, char **argv)<br>{<br><span style="white-space:pre-wrap">    </span>return 0;<br>}<br></div><div><br></div><div><br></div><div><b>compile result</b>:</div><div><br></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)">M:\OpenSource\llvm-trunk\build\Debug\bin>clang++ -fuse-ld=lld -o M:\OpenSource\LLVMTest\LLVMTest\LLVMTest.exe M:\OpenSource\LLVMTest\LLVMTest\main.cpp -g<br>Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file M:\OpenSource\llvm-trunk\include\llvm/Support/Casting.h, line 237<br>0x00000001413F7FBC (0x0000000000000016 0x000000008885E194 0x0000000000000023 0x000007FEDE6945D7), HandleAbort() + 0xC bytes(s), m:\opensource\llvm-trunk\lib\support\windows\signals.inc, line 289<br>0x000007FEDE78396F (0x0000000000000016 0x0000000000000000 0x0000000000B69A28 0xCCCCCCCCCCCCCCCC), raise() + 0x35F bytes(s)<br>0x000007FEDE792060 (0x0000000000B6A140 0x0000000000000240 0x000007FEDE858430 0x0000000145034600), abort() + 0x40 bytes(s)<br>0x000007FEDE77BF78 (0x0000000145034600 0x0000000145034570 0xCCCCCCCC000000ED 0xCCCCCCCCCCCCCCCC), _wassert() + 0x108 bytes(s)<br>0x000000013F96A985 (0x0000000003F38640 0x0000000000B6A8A8 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), llvm::cast<llvm::Instruction,llvm::Value>() + 0x55 bytes(s), m:\opensource\llvm-trunk\include\llvm\support\casting.h, line 237 + 0x37 byte(s)<br>0x0000000140B5DC21 (0x0000000004076260 0x0000000003F2B7A8 0x0000000000B6BF88 0xCCCCCCCCCCCCCCCC), `anonymous namespace'::WinEHPrepare::demoteValuesLiveAcrossHandlers() + 0x481 bytes(s), m:\opensource\llvm-trunk\lib\codegen\winehprepare.cpp, line 644 + 0xD byte(s)<br>0x0000000140B5AA77 (0x0000000004076260 0x0000000003F2B7A8 0x0000000000B6BF88 0xCCCCCCCCCCCCCCCC), `anonymous namespace'::WinEHPrepare::prepareExceptionHandlers(<br>) + 0x187 bytes(s), m:\opensource\llvm-trunk\lib\codegen\winehprepare.cpp, line715<br>0x0000000140B5A821 (0x0000000004076260 0x0000000003F2B7A8 0x0000000003F2B7A8 0xCCCCCCCC00000004), `anonymous namespace'::WinEHPrepare::runOnFunction() + 0x291 b<br>ytes(s), m:\opensource\llvm-trunk\lib\codegen\winehprepare.cpp, line 393<br>0x0000000140C9460E (0x0000000002B556E0 0x0000000003F2B7A8 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), llvm::FPPassManager::runOnFunction() + 0x1AE bytes(s), m:\opensource\llvm-trunk\lib\ir\legacypassmanager.cpp, line 1520 + 0x37 byte(s)<br>0x0000000140C94835 (0x0000000002B556E0 0x000000000015F620 0x000000000015F620 0xCCCCCCCC00000005), llvm::FPPassManager::runOnModule() + 0xA5 bytes(s), m:\opensource\llvm-trunk\lib\ir\legacypassmanager.cpp, line 1540 + 0x1B byte(s)<br>0x0000000140C95C7C (0x0000000002C33110 0x000000000015F620 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), `anonymous namespace'::MPPassManager::runOnModule() + 0x31C bytes(s), m:\opensource\llvm-trunk\lib\ir\legacypassmanager.cpp, line 1596 + 0x40byte(s)<br>0x0000000140C96581 (0x00000000031D79E0 0x000000000015F620 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), llvm::legacy::PassManagerImpl::run() + 0x171 bytes(s), m:\opensource\llvm-trunk\lib\ir\legacypassmanager.cpp, line 1698 + 0x2D byte(s)<br>0x0000000140C8F6A6 (0x000000000403FE90 0x000000000015F620 0x00000000001110D0 0xCCCCCCCCCCCCCCCC), llvm::legacy::PassManager::run() + 0x36 bytes(s), m:\opensource\llvm-trunk\lib\ir\legacypassmanager.cpp, line 1730<br>0x0000000141C648D3 (0x0000000000B6C7C0 0x0000000000000005 0x00000000001110D0 0x00000000000FE330), `anonymous namespace'::EmitAssemblyHelper::EmitAssembly() + 0x443 bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\codegen\backendutil.cpp,line 653<br>0x0000000141C626FB (0x0000000000123650 0x0000000000104150 0x00000000000FE330 0x0000000000106940), clang::EmitBackendOutput() + 0x9B bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\codegen\backendutil.cpp, line 668<br>0x0000000141C3AF2B (0x0000000000161480 0x000000000014C6C0 0x000000000018A1C0 0xCCCCCCCCCCCCCC00), clang::BackendConsumer::HandleTranslationUnit() + 0x38B bytes(s), m:opensource\llvm-trunk\tools\clang\lib\codegen\codegenaction.cpp, line 183<br>0x00000001428E5EC8 (0x000000000018A1C0 0xCCCCCCCC00000000 0x0000000000000000 0xCCCCCCCCCCCCCCCC), clang::ParseAST() + 0x378 bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\parse\parseast.cpp, line 153<br>0x00000001417983DB (0x0000000000123CB0 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), clang::ASTFrontendAction::ExecuteAction() + 0x12B bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\frontend\frontendaction.cpp, line 538<br>0x0000000141C3634C (0x0000000000123CB0 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), clang::CodeGenAction::ExecuteAction() + 0x63C bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\codegen\codegenaction.cpp, line 741<br>0x0000000141797E87 (0x0000000000123CB0 0x00000000000FD970 0x0000000000110950 0xCCCCCCCCCCCCCCCC), clang::FrontendAction::Execute() + 0x97 bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\frontend\frontendaction.cpp, line 444<br>0x000000014173AA0D (0x00000000000FD970 0x0000000000123CB0 0xCCCCCCCCCCCCCCCC 0xCCCCCCCCCCCCCCCC), clang::CompilerInstance::ExecuteAction() + 0x38D bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\frontend\compilerinstance.cpp, line 819<br>0x00000001418EBC33 (0x00000000000FD970 0x0000000000123650 0x0000000000B6DF01 0x0000000000B6D4E0), clang::ExecuteCompilerInvocation() + 0x503 bytes(s), m:\opensource\llvm-trunk\tools\clang\lib\frontendtool\executecompilerinvocation.cpp, line 222 + 0x1D byte(s)<br>0x000000013F8BE710 (0x0000000000B6DCA0 0x0000000000118260 0x000000013F792270 0xCCCCCCCCCCCCCCCC), cc1_main() + 0x450 bytes(s), m:\opensource\llvm-trunk\tools\clang\tools\driver\cc1_main.cpp, line 112 + 0x12 byte(s)<br>0x000000013F8A6F1D (0x0000000000B6F5E0 0x0000000000B6F5F0 0x0000000000B6DDCC 0x0000000000B6E500), ExecuteCC1Tool() + 0xFD bytes(s), m:\opensource\llvm-trunk\tools\clang\tools\driver\driver.cpp, line 358 + 0x61 byte(s)<br>0x000000013F8A74E9 (0x000000010000003C 0x00000000000FBB10 0x0000000000000000 0x0000000143CB4E26), main() + 0x499 bytes(s), m:\opensource\llvm-trunk\tools\clang\tools\driver\driver.cpp, line 404 + 0x9D byte(s)<br>0x0000000143CB3A6D (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), __tmainCRTStartup() + 0x19D bytes(s), f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c, line 626 + 0x19 byte(s)<br>0x0000000143CB3B9E (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), mainCRTStartup() + 0xE bytes(s), f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c, line 466<br>0x0000000076E559ED (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0xD bytes(s)<br>0x0000000076F8C541 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)<br>clang++.exe: error: clang frontend command failed due to signal (use -v to see invocation)<br>clang version 3.7.0 (trunk 240255)<br>Target: x86_64-pc-windows-msvc<br>Thread model: posix<br>clang++.exe: note: diagnostic msg: PLEASE submit a bug report to <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_bugs_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=8kq1lLn_WpoJFSr5tWI34A6loDzsnBz3C3FA9N-zrfQ&s=mnKn_i8y69WNPY_OMk6HJrRLYpqfitYTEK8pK8ApP1k&e=" target="_blank">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and associated run script.<br>clang++.exe: note: diagnostic msg:<br>********************<br><br>PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br>Preprocessed source(s) and associated run script(s) are located at:<br>clang++.exe: note: diagnostic msg: C:\Users\HAIFEN~1\AppData\Local\Temp\main-b94da6.cpp<br>clang++.exe: note: diagnostic msg: C:\Users\HAIFEN~1\AppData\Local\Temp\main-b94da6.sh<br>clang++.exe: note: diagnostic msg:<br><br>********************<br><br>M:\OpenSource\llvm-trunk\build\Debug\bin></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><br></span></div><div><div><span>What</span><span> </span><span>is</span><span> the </span><span>reason for</span><span> </span><span>what</span><span>?</span><span> </span><span>What</span><span> </span><span>should</span><span> I </span><span>do</span><span>?</span></div></div><div><span><br></span></div><div><span>thanks!</span></div><div><span><div style="MARGIN-TOP:10px;MARGIN-LEFT:10px;MARGIN-RIGHT:10px"><div><span style="font-family:宋体;font-size:10.5pt"><div><span style="font-family:宋体;font-size:10.5pt"></span></div></span></div></div></span></div>
            <div></div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>