[LLVMbugs] [Bug 1922] New: clang can't codegen pthread_mutex_t initializer

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Jan 18 02:48:35 PST 2008


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

           Summary: clang can't codegen pthread_mutex_t initializer
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1340)
 --> (http://llvm.org/bugs/attachment.cgi?id=1340)
delta reduced testcase

Using clang r46160, llvm r46160, codegen fails:

$ clang -emit-llvm-bc others.i
clang: CodeGenModule.cpp:304: llvm::Constant* GenerateAggregateInit(const
clang::InitListExpr*, clang::CodeGen::CodeGenModule&): Assertion
`(ILE->getType()->isArrayType() || ILE->getType()->isStructureType()) && "Bad
type for init list!"' failed.
clang[0x65292b]
/lib/libc.so.6[0x363d232090]
/lib/libc.so.6(gsignal+0x35)[0x363d232025]
/lib/libc.so.6(abort+0x110)[0x363d233a80]
/lib/libc.so.6(__assert_fail+0xef)[0x363d22b42f]
clang[0x4a7636]
clang[0x4a6835]
clang(clang::CodeGen::CodeGenModule::EmitGlobalVar(clang::FileVarDecl
const*)+0x80)[0x4a70a0]
clang(clang::CodeGen::CodeGenModule::EmitGlobalVarDeclarator(clang::FileVarDecl
const*)+0x27)[0x4a72f7]
clang(clang::ParseAST(clang::Preprocessor&, clang::ASTConsumer*,
bool)+0x3f8)[0x4e5fd8]
clang[0x49b009]
clang(main+0x9fa)[0x4a0cfa]
/lib/libc.so.6(__libc_start_main+0xf4)[0x363d21e1c4]
clang[0x481589]
Aborted

The original file contains this C code:
#  include <pthread.h>
static pthread_mutex_t cli_gentemp_mutex = PTHREAD_MUTEX_INITIALIZER;


-- 
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