[LLVMbugs] [Bug 11372] New: Compiling code with anonymous struct within anonymous union is casuing a segfault
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Nov 14 09:59:30 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=11372
Bug #: 11372
Summary: Compiling code with anonymous struct within anonymous
union is casuing a segfault
Product: clang
Version: 2.9
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: mdorgan at arena.net
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Attempting to isolate to just the below case does not crash, but it does crash
within our code base. Changing the compiler back to gcc 4.2 within xcode, or
naming the below anonymous union removes the crash and things compiler fine:
// This crashes
class foo {
public:
foo() { }
union
{
struct
{
unsigned short x;
unsigned short y;
unsigned short z;
};
unsigned short vec[3];
};
};
// This works
class foo {
public:
foo() { }
union not_anon
{
struct
{
unsigned short x;
unsigned short y;
unsigned short z;
};
unsigned short vec[3];
};
not_anon u;
};
--version reports
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86+64-apple-darwin10.8.0
Thread model: posix
I am compiling to an Armv7 target. Here is the segfault dump:
0 clang 0x0000000100de1022 PrintStackTrace(void*) + 34
1 clang 0x0000000100de14f9 SignalHandler(int) + 633
2 libSystem.B.dylib 0x00007fff83c4d1ba _sigtramp + 26
3 libSystem.B.dylib 0x000000000006b030 _sigtramp + 2084691600
4 clang 0x00000001002b2b0a
llvm::GetElementPtrInst::GetElementPtrInst<llvm::Value**>(llvm::Value*,
llvm::Value**, llvm::Value**, unsigned int, llvm::Twine const&,
llvm::Instruction*) + 202
5 clang 0x0000000100692a49 llvm::IRBuilder<false,
llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<false>
>::CreateConstInBoundsGEP2_32(llvm::Value*, unsigned int, unsigned int,
llvm::Twine const&) + 185
6 clang 0x00000001002b276c
clang::CodeGen::CodeGenFunction::EmitLValueForField(llvm::Value*,
clang::FieldDecl const*, unsigned int) + 492
7 clang 0x0000000100507fb5
clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(llvm::Value*,
clang::FieldDecl const*, unsigned int) + 85
8 clang 0x000000010050356a
clang::CodeGen::CodeGenFunction::EmitCtorPrologue(clang::CXXConstructorDecl
const*, clang::CXXCtorType, clang::CodeGen::FunctionArgList&) + 1322
9 clang 0x0000000100502c84
clang::CodeGen::CodeGenFunction::EmitConstructorBody(clang::CodeGen::FunctionArgList&)
+ 340
10 clang 0x0000000100684df3
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 675
11 clang 0x0000000100502af3
clang::CodeGen::CodeGenModule::EmitCXXConstructor(clang::CXXConstructorDecl
const*, clang::CXXCtorType) + 243
12 clang 0x000000010068685d
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 285
13 clang 0x000000010011a49d
clang::CodeGen::CodeGenModule::EmitDeferred() + 189
14 clang 0x000000010011a2e4
clang::CodeGen::CodeGenModule::Release() + 20
15 clang 0x000000010011a1ad
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 93
16 clang 0x0000000100042176 clang::ParseAST(clang::Sema&, bool) +
422
17 clang 0x0000000100040baf clang::CodeGenAction::ExecuteAction() +
671
18 clang 0x000000010002cafb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
19 clang 0x000000010002ab78
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2696
20 clang 0x000000010001f365 cc1_main(char const**, char const**,
char const*, void*) + 5333
21 clang 0x000000010000256b main + 667
22 clang 0x00000001000022c4 start + 52
23 clang 0x000000000000006a start + 4294958554
--
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