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

hcc 2.x compiling fails with -DCMAKE_BUILD_TYPE="Debug" #1178

Open
nonpolarity opened this issue Jun 13, 2019 · 3 comments
Open

hcc 2.x compiling fails with -DCMAKE_BUILD_TYPE="Debug" #1178

nonpolarity opened this issue Jun 13, 2019 · 3 comments

Comments

@nonpolarity
Copy link

Scanning dependencies of target hc_am
[100%] Building CXX object lib/hsa/CMakeFiles/hc_am.dir/hc_am.cpp.o
wrong cast for pointers in different address spaces(must be an address space cast)!
UNREACHABLE executed at /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:2044!
Stack dump:
0. Program arguments: /media/justus/data/rocm-2.3/hcc/build/compiler/bin/clang-9 -cc1 -D__KALMAR_HC__=1 -D__HCC_HC__=1 -famp-is-device -fno-builtin -fno-common -O2 -triple amdgcn--amdhsa-hcc -aux-triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name hc_am.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -fuse-init-array -coverage-notes-file /data/rocm-2.3/hcc/build/lib/hsa/CMakeFiles/hc_am.dir/hc_am.cpp.gcno -resource-dir /media/justus/data/rocm-2.3/hcc/build/compiler/lib/clang/9.0.0 -I/media/justus/data/rocm-2.3/hcc/build/compiler/bin/../../include -I/media/justus/data/rocm-2.3/hcc/build/compiler/bin/../../hcc/include -isystem /data/rocm-2.3/hcc/utils -isystem /data/rocm-2.3/ROCR-Runtime/src/inc -D GTEST_HAS_TR1_TUPLE=0 -D hc_am_EXPORTS -I /data/rocm-2.3/hcc/build/include -I /data/rocm-2.3/hcc/include -I /data/rocm-2.3/hcc/compiler/include -I /data/rocm-2.3/hcc/build/lib -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward -internal-isystem /usr/local/include -internal-isystem /media/justus/data/rocm-2.3/hcc/build/compiler/lib/clang/9.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /data/rocm-2.3/hcc/build/lib/hsa -ferror-limit 19 -fmessage-length 200 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -famp -fhsa-ext -o /tmp/hc_am-824a32.s -x hc-kernel /data/rocm-2.3/hcc/lib/hsa/hc_am.cpp -fgpu-rdc -emit-llvm-bc

  1.  /media/justus/data/rocm-2.3/hcc/build/compiler/bin/../../include/hsa_atomic.h:9:1: current parser token 'extern'
    
  2.  /media/justus/data/rocm-2.3/hcc/build/compiler/bin/../../include/kalmar_math.h:294:11: LLVM IR generation of declaration 'Kalmar'
    
  3.  /media/justus/data/rocm-2.3/hcc/build/compiler/bin/../../include/kalmar_math.h:489:15: Generating code for declaration 'Kalmar::fast_math::frexpf'
    

#0 0x000056488915f657 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /data/rocm-2.3/hcc/compiler/lib/Support/Unix/Signals.inc:494:0
#1 0x000056488915f6ea PrintStackTraceSignalHandler(void*) /data/rocm-2.3/hcc/compiler/lib/Support/Unix/Signals.inc:558:0
#2 0x000056488915d66e llvm::sys::RunSignalHandlers() /data/rocm-2.3/hcc/compiler/lib/Support/Signals.cpp:68:0
#3 0x000056488915f079 SignalHandler(int) /data/rocm-2.3/hcc/compiler/lib/Support/Unix/Signals.inc:357:0
#4 0x00007fedf225f890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#5 0x00007fedf0f10e97 gsignal /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007fedf0f12801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
#7 0x00005648890ee295 bindingsErrorHandler(void*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool) /data/rocm-2.3/hcc/compiler/lib/Support/ErrorHandling.cpp:230:0
#8 0x0000564889884855 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:2047:0
#9 0x000056488987cfc8 (anonymous namespace)::ScalarExprEmitter::VisitExplicitCastExpr(clang::ExplicitCastExpr*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:580:0
#10 0x0000564889895779 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::VisitCStyleCastExpr(clang::CStyleCastExpr*) /data/rocm-2.3/hcc/build/compiler/tools/clang/include/clang/AST/StmtNodes.inc:805:0
#11 0x00005648898940e7 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) /data/rocm-2.3/hcc/build/compiler/tools/clang/include/clang/AST/StmtNodes.inc:805:0
#12 0x000056488987c211 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:426:0
#13 0x0000564889891a6b clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:4481:0
#14 0x000056488982e89f clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExpr.cpp:212:0
#15 0x000056488982ea71 clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(clang::Expr const*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExpr.cpp:231:0
#16 0x00005648897c7d58 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGCall.cpp:3656:0
#17 0x00005648897c6f49 clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, llvm::ArrayRefclang::QualType, llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr const* const, clang::Stmt const* const> >, clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, clang::CodeGen::CodeGenFunction::EvaluationOrder) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGCall.cpp:3503:0
#18 0x00005648896eaa40 void clang::CodeGen::CodeGenFunction::EmitCallArgsclang::FunctionProtoType(clang::CodeGen::CallArgList&, clang::FunctionProtoType const*, llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr const* const, clang::Stmt const* const> >, clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, clang::CodeGen::CodeGenFunction::EvaluationOrder) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenFunction.h:4280:0
#19 0x0000564889849b44 clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, clang::CodeGen::CGCallee const&, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot, llvm::Value*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExpr.cpp:4763:0
#20 0x00005648898475c7 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExpr.cpp:4382:0
#21 0x000056488987d069 (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:587:0
#22 0x000056488989406f clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) /data/rocm-2.3/hcc/build/compiler/tools/clang/include/clang/AST/StmtNodes.inc:765:0
#23 0x000056488987c211 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:426:0
#24 0x0000564889891a6b clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGExprScalar.cpp:4481:0
#25 0x000056488980730a clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGDecl.cpp:756:0
#26 0x000056488980d127 clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGDecl.cpp:1945:0
#27 0x000056488980cdce clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission const&) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGDecl.cpp:1904:0
#28 0x0000564889809f19 clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGDecl.cpp:1351:0
#29 0x0000564889804a0a clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGDecl.cpp:188:0
#30 0x000056488980470f clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGDecl.cpp:135:0
#31 0x00005648894ed644 clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGStmt.cpp:1128:0
#32 0x00005648894e99e2 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGStmt.cpp:350:0
#33 0x00005648894e8d2f clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGStmt.cpp:49:0
#34 0x00005648894e9cc5 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) /data/rocm-2.3/hcc/clang/lib/CodeGen/CGStmt.cpp:384:0
#35 0x000056488956d093 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenFunction.cpp:1257:0
#36 0x000056488956dfd8 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenFunction.cpp:1441:0
#37 0x00005648895959e8 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:4210:0
#38 0x000056488958ec5f clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:2655:0
#39 0x000056488958d752 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:2314:0
#40 0x00005648895998f9 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:5015:0
#41 0x00005648895997cf clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:4984:0
#42 0x0000564889599a92 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:5040:0
#43 0x00005648895997cf clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:4984:0
#44 0x0000564889599a92 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenModule.cpp:5040:0
#45 0x000056488a39aa21 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) /data/rocm-2.3/hcc/clang/lib/CodeGen/ModuleBuilder.cpp:161:0
#46 0x000056488a3948a0 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenAction.cpp:172:0
#47 0x000056488b852f72 clang::ParseAST(clang::Sema&, bool, bool) /data/rocm-2.3/hcc/clang/lib/Parse/ParseAST.cpp:160:0
#48 0x0000564889b560dd clang::ASTFrontendAction::ExecuteAction() /data/rocm-2.3/hcc/clang/lib/Frontend/FrontendAction.cpp:1035:0
#49 0x000056488a3932e3 clang::CodeGenAction::ExecuteAction() /data/rocm-2.3/hcc/clang/lib/CodeGen/CodeGenAction.cpp:1061:0
#50 0x0000564889b55acc clang::FrontendAction::Execute() /data/rocm-2.3/hcc/clang/lib/Frontend/FrontendAction.cpp:938:0
#51 0x0000564889af1eee clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /data/rocm-2.3/hcc/clang/lib/Frontend/CompilerInstance.cpp:952:0
#52 0x0000564889cacb5a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /data/rocm-2.3/hcc/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:271:0
#53 0x00005648878dcb74 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /data/rocm-2.3/hcc/clang/tools/driver/cc1_main.cpp:218:0
#54 0x00005648878d239b ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /data/rocm-2.3/hcc/clang/tools/driver/driver.cpp:309:0
#55 0x00005648878d2aaa main /data/rocm-2.3/hcc/clang/tools/driver/driver.cpp:381:0
#56 0x00007fedf0ef3b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#57 0x00005648878d0b4a _start (/media/justus/data/rocm-2.3/hcc/build/compiler/bin/clang-9+0x21f5b4a)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see invocation)
HCC clang version 9.0.0 (https://github.com/RadeonOpenCompute/hcc-clang-upgrade.git 785f31db116e742ac53d052e207979869a857d1a) (https://github.com/RadeonOpenCompute/llvm.git 87f982f8ce2b85ce824f91bf8c2c90f6843a50a3) (based on HCC 1.3.19144-fd93baed-785f31db11-87f982f8ce2 )
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /data/rocm-2.3/hcc/build/compiler/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/hc_am-60f068.cpp
clang-9: note: diagnostic msg: /tmp/hc_am-56368f.cpp
clang-9: note: diagnostic msg: /tmp/hc_am-60f068.sh
clang-9: note: diagnostic msg:


lib/hsa/CMakeFiles/hc_am.dir/build.make:62: recipe for target 'lib/hsa/CMakeFiles/hc_am.dir/hc_am.cpp.o' failed
make[2]: *** [lib/hsa/CMakeFiles/hc_am.dir/hc_am.cpp.o] Error 254
make[2]: *** Deleting file 'lib/hsa/CMakeFiles/hc_am.dir/hc_am.cpp.o'
CMakeFiles/Makefile2:143897: recipe for target 'lib/hsa/CMakeFiles/hc_am.dir/all' failed
make[1]: *** [lib/hsa/CMakeFiles/hc_am.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

@zhaozhangjian
Copy link

Hi,
I ran into the same issue as yours, have you solved the problem yet?

@nonpolarity
Copy link
Author

Maybe you can try -DCMAKE_BUILD_TYPE="RelWithDebInfo".

@zhaozhangjian
Copy link

Hi,
Thanks for your reply! I tried this option and the building passed, some debug info such as virtual address was still optimized out. But I can see much more debug info now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants