<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assertion "Only storage fields have tail padding""
   href="http://llvm.org/bugs/show_bug.cgi?id=19514">19514</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion "Only storage fields have tail padding"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While running clang, I am hitting an assertion failure in the front-end of the
compiler.

Clang information:
-    Host: AMD64
-    Target: AMD64
-    Host OS: Linux (Ubuntu 13.10)
-    SVN Revision: 204763 (This failure has also been observed in revision
206712)

The assert that failed is the following:

clang:
/home/snc/llvm/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:507: void
{anonymous}::CGRecordLowering::clipTailPadding(): Assertion `Prior->Kind ==
MemberInfo::Field && !Prior->FD && "Only storage fields have tail padding!"'
failed.

To reproduce this failure, compile the following code with the command line
“clang -c repro.cpp”:

struct A { };
struct D { int fld4; };
struct B: virtual D, A { };
struct C: B, A { void vf1 (); };
void C::vf1 () { }

When trying to compile the code above, the compiler asserts and fails with the
following stacktrace:

clang:
/home/snc/llvm/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:507: void
{anonymous}::CGRecordLowering::clipTailPadding(): Assertion `Prior->Kind ==
MemberInfo::Field && !Prior->FD && "Only storage fields have tail padding!"'
failed.
0  clang           0x00000000036cd47a llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x00000000036cd6f7
2  clang           0x00000000036cd0ab
3  libpthread.so.0 0x00007fe73dbb2bb0
4  libc.so.6       0x00007fe73cdeff77 gsignal + 55
5  libc.so.6       0x00007fe73cdf35e8 abort + 328
6  libc.so.6       0x00007fe73cde8d43
7  libc.so.6       0x00007fe73cde8df2
8  clang           0x00000000011c0157
9  clang           0x00000000011bec34
10 clang           0x00000000011c0cae
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*) + 100
11 clang           0x000000000125689b
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*) +
619
12 clang           0x00000000012556be
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 172
13 clang           0x0000000001254e1c
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType) + 36
14 clang           0x0000000001255b03
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 1265
15 clang           0x000000000127b603
16 clang           0x000000000127ba7b
17 clang           0x00000000012a19b1
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
bool, llvm::ArrayRef<clang::CanQual<clang::Type> >,
clang::FunctionType::ExtInfo, clang::CodeGen::RequiredArgs) + 6
15
18 clang           0x000000000129fd84
19 clang           0x000000000129fe3a
20 clang           0x00000000012a010f
clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(clang::CXXRecordDecl const*,
clang::FunctionProtoType const*) + 259
21 clang           0x00000000012a021e
clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(clang::CXXMethodDecl
const*) + 220
22 clang           0x00000000012a0a9a
clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(clang::FunctionDecl
const*) + 78
23 clang           0x00000000012a1063
clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(clang::GlobalDecl) + 175
24 clang           0x00000000011ff591
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 111
25 clang           0x00000000011fcb03
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 349
26 clang           0x00000000011fc475
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 683
27 clang           0x00000000012031d3
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 307
28 clang           0x000000000117c0ee
29 clang           0x000000000117896a
30 clang           0x0000000001393ff4 clang::ParseAST(clang::Sema&, bool, bool)
+ 554
31 clang           0x0000000000ef5d58 clang::ASTFrontendAction::ExecuteAction()
+ 322
32 clang           0x000000000117a758 clang::CodeGenAction::ExecuteAction() +
1362
33 clang           0x0000000000ef588b clang::FrontendAction::Execute() + 205
34 clang           0x0000000000ec6f4e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
35 clang           0x0000000000e90217
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1029
36 clang           0x0000000000e7fa85 cc1_main(char const**, char const**, char
const*, void*) + 717
37 clang           0x0000000000e8bbc4 main + 785
38 libc.so.6       0x00007fe73cddade5 __libc_start_main + 245
39 clang           0x0000000000e7e189
Stack dump:
0.      Program arguments: /home/snc/llvm/build/Debug+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name repro.cpp -mrelocation-model static -mdisable-fp-elim
-fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -target-linker-version 2.23.52.20130913 -coverage-file
repro.o -resource-dir /home/snc/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../inc
lude/c++/4.8/x86_64-linux-gnu -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem /u
sr/local/include -internal-isystem
/home/snc/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -fdep
recated-macro -fdebug-compilation-dir repro/minimal -ferror-limit 19
-fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fd
iagnostics-show-option -vectorize-slp -o repro.o -x c++ repro.cpp
1.      <eof> parser at end of file
2.      repro.cpp:5:9: LLVM IR generation of declaration 'C::vf1'
3.      repro.cpp:5:9: Generating code for declaration 'C::vf1'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (trunk 204763)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/repro-65371b.cpp
clang: note: diagnostic msg: /tmp/repro-65371b.sh
clang: note: diagnostic msg:

********************</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>