[Libclc-dev] clang SVN r303370 broke libclc

Michel Dänzer via Libclc-dev libclc-dev at lists.llvm.org
Fri May 19 01:35:29 PDT 2017


Hi Yaxun,


since clang SVN r303370 ("CodeGen: Cast alloca to expected address
space"), libclc[0] fails to build for me, see below.

[0] configured with ./configure.py --with-llvm-config=$HOME/src/llvm-git/llvm/build-amd64/bin/llvm-config -g ninja amdgcn-mesa-mesa3d amdgcn--amdhsa


[6/356] LLVM-CC amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc
FAILED: amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc 
/home/daenzer/src/llvm-git/llvm/build-amd64/bin/clang -MMD -MF amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc.d -target amdgcn-mesa-mesa3d -I`dirname amdgcn-amdhsa/lib/workitem/get_num_groups.cl` -I./generic/include -fno-builtin -D__CLC_INTERNAL -emit-llvm -mcpu=tahiti -c -o amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc amdgcn-amdhsa/lib/workitem/get_num_groups.cl
clang-5.0: /home/daenzer/src/llvm-git/llvm/lib/IR/Instructions.cpp:2681: static llvm::CastInst *llvm::CastInst::Create(Instruction::CastOps, llvm::Value *, llvm::Type *, const llvm::Twine &, llvm::Instruction *): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
#0 0x00007f504a1c17e9 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/daenzer/src/llvm-git/llvm/build-amd64/../lib/Support/Unix/Signals.inc:398:13
#1 0x00007f504a1c17e9 PrintStackTraceSignalHandler(void*) /home/daenzer/src/llvm-git/llvm/build-amd64/../lib/Support/Unix/Signals.inc:461:0
#2 0x00007f504a1c1b36 bool __gnu_cxx::operator!=<std::pair<void (*)(void*), void*>*, std::vector<std::pair<void (*)(void*), void*>, std::allocator<std::pair<void (*)(void*), void*> > > >(__gnu_cxx::__normal_iterator<std::pair<void (*)(void*), void*>*, std::vector<std::pair<void (*)(void*), void*>, std::allocator<std::pair<void (*)(void*), void*> > > > const&, __gnu_cxx::__normal_iterator<std::pair<void (*)(void*), void*>*, std::vector<std::pair<void (*)(void*), void*>, std::allocator<std::pair<void (*)(void*), void*> > > > const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_iterator.h:880:27
#3 0x00007f504a1c1b36 llvm::sys::RunSignalHandlers() /home/daenzer/src/llvm-git/llvm/lib/Support/Signals.cpp:43:0
#4 0x00007f504a1c1b36 SignalHandler(int) /home/daenzer/src/llvm-git/llvm/build-amd64/../lib/Support/Unix/Signals.inc:242:0
#5 0x00007f504c6f40c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#6 0x00007f5049035fcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#7 0x00007f50490373fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#8 0x00007f504902ee37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#9 0x00007f504902eee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#10 0x00007f504a2a33ab llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*) /home/daenzer/src/llvm-git/llvm/lib/IR/Instructions.cpp:2697:12
#11 0x0000000000780e27 llvm::IRBuilder<llvm::ConstantFolder, clang::CodeGen::CGBuilderInserter>::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&) /home/daenzer/src/llvm-git/llvm/build-amd64/../include/llvm/IR/IRBuilder.h:0:19
#12 0x0000000000780e27 llvm::IRBuilder<llvm::ConstantFolder, clang::CodeGen::CGBuilderInserter>::CreateBitCast(llvm::Value*, llvm::Type*, llvm::Twine const&) /home/daenzer/src/llvm-git/llvm/build-amd64/../include/llvm/IR/IRBuilder.h:1426:0
#13 0x0000000000780e27 clang::CodeGen::CodeGenFunction::EmitLifetimeEnd(llvm::Value*, llvm::Value*) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CGDecl.cpp:939:0
#14 0x0000000000779839 EmitCleanup(clang::CodeGen::CodeGenFunction&, clang::CodeGen::EHScopeStack::Cleanup*, clang::CodeGen::EHScopeStack::Cleanup::Flags, clang::CodeGen::Address) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp:562:3
#15 0x0000000000778679 llvm::IRBuilderBase::GetInsertBlock() const /home/daenzer/src/llvm-git/llvm/build-amd64/../include/llvm/IR/IRBuilder.h:122:47
#16 0x0000000000778679 clang::CodeGen::CodeGenFunction::PopCleanupBlock(bool) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp:888:0
#17 0x00000000007771e6 clang::CodeGen::EHScopeStack::stable_begin() const /home/daenzer/src/llvm-git/llvm/build-amd64/../tools/clang/lib/CodeGen/EHScopeStack.h:380:28
#18 0x00000000007771e6 clang::CodeGen::CodeGenFunction::PopCleanupBlocks(clang::CodeGen::EHScopeStack::stable_iterator, std::initializer_list<llvm::Value**>) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp:426:0
#19 0x00000000006759f2 clang::CodeGen::CodeGenFunction::FinishFunction(clang::SourceLocation) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:0:5
#20 0x000000000067af1f clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:1221:8
#21 0x000000000069016e clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3058:3
#22 0x000000000068a874 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:1914:12
#23 0x0000000000692aaa clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:3785:5
#24 0x0000000000a2334f (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp:151:73
#25 0x0000000000a20b0a clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:138:11
#26 0x0000000000c4f9b2 clang::ParseAST(clang::Sema&, bool, bool) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/Parse/ParseAST.cpp:151:9
#27 0x000000000099a2fb clang::FrontendAction::Execute() /home/daenzer/src/llvm-git/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:841:10
#28 0x000000000095ee01 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:971:11
#29 0x0000000000a1c6a3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/daenzer/src/llvm-git/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:25
#30 0x00000000005b81b8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/daenzer/src/llvm-git/llvm/tools/clang/tools/driver/cc1_main.cpp:221:13
#31 0x00000000005b6aa8 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/daenzer/src/llvm-git/llvm/tools/clang/tools/driver/driver.cpp:299:12
#32 0x00000000005b6aa8 main /home/daenzer/src/llvm-git/llvm/tools/clang/tools/driver/driver.cpp:380:0
#33 0x00007f50490232b1 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#34 0x00000000005b3d6a _start (/home/daenzer/src/llvm-git/llvm/build-amd64/bin/clang-5.0+0x5b3d6a)
Stack dump:
0.	Program arguments: /home/daenzer/src/llvm-git/llvm/build-amd64/bin/clang-5.0 -cc1 -triple amdgcn-mesa-mesa3d -emit-llvm-bc -emit-llvm-uselists -disable-free -main-file-name get_num_groups.cl -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -target-cpu tahiti -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/daenzer/src/llvm-git/libclc/amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.gcno -resource-dir /home/daenzer/src/llvm-git/llvm/build-amd64/lib/clang/5.0.0 -dependency-file amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc.d -MT amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc -I amdgcn-amdhsa/lib/workitem -I ./generic/include -D __CLC_INTERNAL -fno-dwarf-directory-asm -fdebug-compilation-dir /home/daenzer/src/llvm-git/libclc -ferror-limit 19 -fmessage-length 0 -fno-builtin -fobjc-runtime=gcc -fdiagnostics-show-option -o amdgcn-mesa-mesa3d/lib/workitem/get_num_groups.cl.tahiti.bc -x cl amdgcn-amdhsa/lib/workitem/get_num_groups.cl 
1.	<eof> parser at end of file
2.	amdgcn-amdhsa/lib/workitem/get_num_groups.cl:4:17: LLVM IR generation of declaration 'get_num_groups'
3.	amdgcn-amdhsa/lib/workitem/get_num_groups.cl:4:17: Generating code for declaration 'get_num_groups'
clang-5.0: error: unable to execute command: Aborted
clang-5.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 5.0.0 (http://llvm.org/git/clang.git 3022dac388832e0bb669821e6677abd5cb8a8784) (llvm/trunk 303323)
Target: amdgcn-mesa-mesa3d
Thread model: posix
InstalledDir: /home/daenzer/src/llvm-git/llvm/build-amd64/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-5.0: note: diagnostic msg: 
********************


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the Libclc-dev mailing list