[LLVMbugs] [Bug 7686] New: Segfault in codegen

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 21 10:38:46 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7686

           Summary: Segfault in codegen
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: collinwinter at google.com
                CC: chandlerc at gmail.com, llvmbugs at cs.uiuc.edu


Created an attachment (id=5252)
 --> (http://llvm.org/bugs/attachment.cgi?id=5252)
Reduced test case

As of r109013, Clang segfaults when generating code for the attached test case.
gcc compiles the test case with no issues.

$ /g/users/collinwinter/llvm/obj/Release/bin/clang -x c++ -c varzclient.pic.ii
varzclient.pic.ii:16:1: warning: control reaches end of non-void function
[-Wreturn-type]
}
^
0  clang           0x00000000018e6b5f
1  clang           0x00000000018e741f
2  libpthread.so.0 0x00002aaaaabcf700
3  clang           0x000000000180517a llvm::Instruction::Instruction(llvm::Type
const*, unsigned int, llvm::Use*, unsigned int, llvm::Instruction*) + 138
4  clang           0x0000000001810ad9 llvm::StoreInst::StoreInst(llvm::Value*,
llvm::Value*, llvm::Instruction*) + 89
5  clang           0x00000000009c0355
6  clang           0x00000000009c0a73
clang::CodeGen::CodeGenFunction::PopCleanupBlock() + 531
7  clang           0x00000000009c0cf8
clang::CodeGen::CodeGenFunction::PopCleanupBlocks(clang::CodeGen::EHScopeStack::stable_iterator)
+ 56
8  clang           0x000000000099e445
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, llvm::Value*, bool) + 389
9  clang           0x000000000099e5ad
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 189
10 clang           0x000000000099c4b3
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 35
11 clang           0x000000000099e189
clang::CodeGen::CodeGenFunction::EmitIfStmt(clang::IfStmt const&) + 441
12 clang           0x000000000099c69b
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 523
13 clang           0x000000000099e395
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, llvm::Value*, bool) + 213
14 clang           0x000000000099e5ad
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 189
15 clang           0x000000000099c4b3
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 35
16 clang           0x00000000009bfc12
clang::CodeGen::CodeGenFunction::GenerateCode(clang::CodeGen::GlobalDecl,
llvm::Function*) + 818
17 clang           0x00000000008b090b
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::CodeGen::GlobalDecl)
+ 619
18 clang           0x00000000008b141e
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 238
19 clang           0x00000000008b181d
clang::CodeGen::CodeGenModule::EmitGlobal(clang::CodeGen::GlobalDecl) + 749
20 clang           0x00000000008b2d3d
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 509
21 clang           0x00000000008a66e1 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 65
22 clang           0x00000000008a5f67 (anonymous
namespace)::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 167
23 clang           0x00000000009f5b66 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 246
24 clang           0x00000000008a4d23 clang::CodeGenAction::ExecuteAction() +
51
25 clang           0x00000000007a8ee0
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 272
26 clang           0x000000000078d5c8 cc1_main(char const**, char const**, char
const*, void*) + 2168
27 clang           0x00000000007936cb main + 2955
28 libc.so.6       0x00002aaaab2894cb __libc_start_main + 219
29 clang           0x000000000078bb9a
Stack dump:
0.    Program arguments: /g/users/collinwinter/llvm/obj/Release/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-main-file-name varzclient.pic.ii -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -resource-dir
/g/users/collinwinter/llvm/obj/Release/lib/clang/2.8 -ferror-limit 19
-fmessage-length 163 -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cc-dI3LHQ.s -x c++ varzclient.pic.ii 
1.    <eof> parser at end of file
2.    varzclient.pic.ii:8:6: LLVM IR generation of declaration 'HandleResult'
3.    varzclient.pic.ii:8:6: Generating code for declaration 'HandleResult'
4.    varzclient.pic.ii:8:21: LLVM IR generation of compound statement ('{}')
5.    varzclient.pic.ii:10:30: LLVM IR generation of compound statement ('{}')
clang: error: clang frontend command failed due to signal 11 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list