[LLVMbugs] [Bug 9683] Assert generated when clang GEP's into nested unnamed structs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 26 12:36:05 PDT 2011


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

Max Burke <mburke at ea.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |

--- Comment #2 from Max Burke <mburke at ea.com> 2011-05-26 14:36:04 CDT ---
Hi Douglas,

I've re-verified this with top-of-tree. I added a small main function that
creates an instance of the QueueEntry structure:

int main(void)
{
    QueueEntry QE;
    QE.mValue = 0;
}

And it aborts with a similar, if not the same, callstack:


mburke at D1018130-linux:~/src/tmp$
/home/mburke/src/build/Release+Asserts/bin/clang -D EA_DEBUG -D _DEBUG -D
EA_PLATFORM_LINUX=1  -Wall  -Wno-deprecated-declarations  -fno-rtti 
-fno-exceptions  -Werror  -O0  -fno-strict-aliasing  -g3  -c  -fno-common 
-fshort-wchar  -fmessage-length=0  -m64  -march=athlon64 test2.cpp
clang: /home/mburke/src/llvm/include/llvm/Instructions.h:278: const llvm::Type*
llvm::checkType(const llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst
indices for type!"' failed.
0  clang           0x0000000001a4285f
1  clang           0x0000000001a4339a
2  libpthread.so.0 0x00007f1589b12c60
3  libc.so.6       0x00007f1588dfdd05 gsignal + 53
4  libc.so.6       0x00007f1588e01ab6 abort + 390
5  libc.so.6       0x00007f1588df67c5 __assert_fail + 245
6  clang           0x000000000081e118
7  clang           0x000000000081e1ff
8  clang           0x000000000082640a
clang::CodeGen::CodeGenFunction::EmitLValueForField(llvm::Value*,
clang::FieldDecl const*, unsigned int) + 346
9  clang           0x00000000008268bb
clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(llvm::Value*,
clang::FieldDecl const*, unsigned int) + 91
10 clang           0x00000000007eb682
clang::CodeGen::CodeGenFunction::EmitCtorPrologue(clang::CXXConstructorDecl
const*, clang::CXXCtorType, clang::CodeGen::FunctionArgList&) + 610
11 clang           0x00000000007ec445
clang::CodeGen::CodeGenFunction::EmitConstructorBody(clang::CodeGen::FunctionArgList&)
+ 133
12 clang           0x00000000008da9ed
clang::CodeGen::CodeGenFunction::GenerateCode(clang::CodeGen::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 973
13 clang           0x00000000007d52bf
clang::CodeGen::CodeGenModule::EmitCXXConstructor(clang::CXXConstructorDecl
const*, clang::CXXCtorType) + 175
14 clang           0x00000000007b0fb1
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 273
15 clang           0x00000000007b11c3
clang::CodeGen::CodeGenModule::EmitDeferred() + 163
16 clang           0x00000000007b1259 clang::CodeGen::CodeGenModule::Release()
+ 9
17 clang           0x00000000007a45d2
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 98
18 clang           0x00000000008f59bd clang::ParseAST(clang::Sema&, bool) + 333
19 clang           0x00000000007a32c4 clang::CodeGenAction::ExecuteAction() +
68
20 clang           0x00000000006a0423
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
21 clang           0x00000000006799ea
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1130
22 clang           0x000000000066e635 cc1_main(char const**, char const**, char
const*, void*) + 789
23 clang           0x0000000000678993 main + 7283
24 libc.so.6       0x00007f1588de8eff __libc_start_main + 255
25 clang           0x000000000066e139
Stack dump:
0.    Program arguments: /home/mburke/src/build/Release+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name test2.cpp -mrelocation-model static -mdisable-fp-elim
-relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu athlon64 -target-linker-version 2.21.0.20110327
-momit-leaf-frame-pointer -g -coverage-file test2.o -resource-dir
/home/mburke/src/build/Release+Asserts/bin/../lib/clang/3.0 -D EA_DEBUG -D
_DEBUG -D EA_PLATFORM_LINUX=1 -O0 -Wall -Wno-deprecated-declarations -Werror
-fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -fno-rtti -fgnu-runtime
-fshort-wchar -fno-common -fdiagnostics-show-option -fcolor-diagnostics -o
test2.o -x c++ test2.cpp 
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    test2.cpp:34:5: Generating code for declaration 'QueueEntry::QueueEntry'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)


mburke at D1018130-linux:~/src/tmp$
/home/mburke/src/build/Release+Asserts/bin/clang -v
clang version 3.0 (trunk 132125)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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