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

Compiler crash in EmitCallArg #1295

Open
pfultz2 opened this issue Oct 31, 2019 · 0 comments
Open

Compiler crash in EmitCallArg #1295

pfultz2 opened this issue Oct 31, 2019 · 0 comments

Comments

@pfultz2
Copy link
Contributor

pfultz2 commented Oct 31, 2019

When compiling this code with hcc:

struct b {
  int c[0];
  __attribute__((hc)) auto d(b) {}
};
__attribute__((hc)) void e() {
  b a;
  a.d({{}});
}

It crashes with:

Stack dump:
0.	Program arguments: /opt/rocm/hcc/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 -disable-llvm-verifier -main-file-name test.cpp -mrelocation-model pic -pic-level 1 -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -fuse-init-array -coverage-notes-file /home/pfultz/gitlab/rtglib/build/test.gcno -resource-dir /opt/rocm/hcc/lib/clang/9.0.0 -I/opt/rocm/bin/../include -I/opt/rocm/bin/../hcc/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/local/include -internal-isystem /opt/rocm/hcc/lib/clang/9.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Wextra -std=c++14 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /home/pfultz/gitlab/rtglib/build -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -famp -fhsa-ext -fgpu-rdc -emit-llvm-bc -o /tmp/test-b16471.s -x hc-kernel test.cpp 
1.	<eof> parser at end of file
2.	test.cpp:5:26: LLVM IR generation of declaration 'e'
3.	test.cpp:5:26: Generating code for declaration 'e'
 #0 0x000000000198f3fa llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/opt/rocm/hcc/bin/clang-9+0x198f3fa)
 #1 0x000000000198d2cc llvm::sys::RunSignalHandlers() (/opt/rocm/hcc/bin/clang-9+0x198d2cc)
 #2 0x000000000198d437 SignalHandler(int) (/opt/rocm/hcc/bin/clang-9+0x198d437)
 #3 0x00007f6bec582890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00000000036757ab clang::TagType::getDecl() const (/opt/rocm/hcc/bin/clang-9+0x36757ab)
 #5 0x0000000001d333eb clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) (/opt/rocm/hcc/bin/clang-9+0x1d333eb)
 #6 0x0000000001d33c91 clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, llvm::ArrayRef<clang::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) (/opt/rocm/hcc/bin/clang-9+0x1d33c91)
 #7 0x0000000001cc3882 void clang::CodeGen::CodeGenFunction::EmitCallArgs<clang::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) (/opt/rocm/hcc/bin/clang-9+0x1cc3882)
 #8 0x0000000001d3f680 clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(clang::CXXConstructorDecl const*, clang::CXXCtorType, bool, bool, clang::CodeGen::AggValueSlot, clang::CXXConstructExpr const*) (/opt/rocm/hcc/bin/clang-9+0x1d3f680)
 #9 0x0000000001d9a9b1 clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr(clang::CXXConstructExpr const*, clang::CodeGen::AggValueSlot) (/opt/rocm/hcc/bin/clang-9+0x1d9a9b1)
#10 0x00000000008880f5 (anonymous namespace)::AggExprEmitter::VisitCXXConstructExpr(clang::CXXConstructExpr const*) (/opt/rocm/hcc/bin/clang-9+0x8880f5)
#11 0x0000000001d8d148 (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) (/opt/rocm/hcc/bin/clang-9+0x1d8d148)
#12 0x0000000001d8de4a clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/opt/rocm/hcc/bin/clang-9+0x1d8de4a)
#13 0x0000000001d6e952 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/rocm/hcc/bin/clang-9+0x1d6e952)
#14 0x0000000001d6ead6 clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(clang::Expr const*) (/opt/rocm/hcc/bin/clang-9+0x1d6ead6)
#15 0x0000000001d32803 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) (/opt/rocm/hcc/bin/clang-9+0x1d32803)
#16 0x0000000001d33c91 clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, llvm::ArrayRef<clang::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) (/opt/rocm/hcc/bin/clang-9+0x1d33c91)
#17 0x0000000001d92de8 commonEmitCXXMemberOrOperatorCall(clang::CodeGen::CodeGenFunction&, clang::CXXMethodDecl const*, llvm::Value*, llvm::Value*, clang::QualType, clang::CallExpr const*, clang::CodeGen::CallArgList&, clang::CodeGen::CallArgList*) [clone .constprop.390] (/opt/rocm/hcc/bin/clang-9+0x1d92de8)
#18 0x0000000001d9346b clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(clang::CXXMethodDecl const*, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot, llvm::Value*, llvm::Value*, clang::QualType, clang::CallExpr const*, clang::CodeGen::CallArgList*) (/opt/rocm/hcc/bin/clang-9+0x1d9346b)
#19 0x0000000001d9b9f4 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) (/opt/rocm/hcc/bin/clang-9+0x1d9b9f4)
#20 0x0000000001d9ca49 clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(clang::CXXMemberCallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/rocm/hcc/bin/clang-9+0x1d9ca49)
#21 0x0000000001d8728b clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/rocm/hcc/bin/clang-9+0x1d8728b)
#22 0x000000000088e50c (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) (/opt/rocm/hcc/bin/clang-9+0x88e50c)
#23 0x0000000001db4f8d (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) (/opt/rocm/hcc/bin/clang-9+0x1db4f8d)
#24 0x0000000001db5930 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/rocm/hcc/bin/clang-9+0x1db5930)
#25 0x0000000001d6e9b7 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/rocm/hcc/bin/clang-9+0x1d6e9b7)
#26 0x0000000001d7f6e5 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/rocm/hcc/bin/clang-9+0x1d7f6e5)
#27 0x0000000001bc2afd clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/rocm/hcc/bin/clang-9+0x1bc2afd)
#28 0x0000000001bc30a3 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/rocm/hcc/bin/clang-9+0x1bc30a3)
#29 0x0000000001bf7d40 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/rocm/hcc/bin/clang-9+0x1bf7d40)
#30 0x0000000001c03377 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/rocm/hcc/bin/clang-9+0x1c03377)
#31 0x0000000001c325f1 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/rocm/hcc/bin/clang-9+0x1c325f1)
#32 0x0000000001c30524 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/rocm/hcc/bin/clang-9+0x1c30524)
#33 0x0000000001c30d34 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/rocm/hcc/bin/clang-9+0x1c30d34)
#34 0x0000000001c35a27 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone .part.4354] [clone .constprop.4360] (/opt/rocm/hcc/bin/clang-9+0x1c35a27)
#35 0x00000000024db403 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/rocm/hcc/bin/clang-9+0x24db403)
#36 0x00000000024d2614 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/rocm/hcc/bin/clang-9+0x24d2614)
#37 0x0000000002d21ee8 clang::ParseAST(clang::Sema&, bool, bool) (/opt/rocm/hcc/bin/clang-9+0x2d21ee8)
#38 0x00000000024d8c17 clang::CodeGenAction::ExecuteAction() (/opt/rocm/hcc/bin/clang-9+0x24d8c17)
#39 0x0000000001fe4526 clang::FrontendAction::Execute() (/opt/rocm/hcc/bin/clang-9+0x1fe4526)
#40 0x0000000001faa6f6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/rocm/hcc/bin/clang-9+0x1faa6f6)
#41 0x000000000208274c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/rocm/hcc/bin/clang-9+0x208274c)
#42 0x000000000097f587 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/rocm/hcc/bin/clang-9+0x97f587)
#43 0x0000000000912a2d main (/opt/rocm/hcc/bin/clang-9+0x912a2d)
#44 0x00007f6beb216b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#45 0x000000000097cfa9 _start (/opt/rocm/hcc/bin/clang-9+0x97cfa9)
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

1 participant