<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 --- - LLDB asserts "Cannot get layout of forward declarations!" from RecordLayoutBuilder.cpp:2782"
href="http://llvm.org/bugs/show_bug.cgi?id=20781">20781</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLDB asserts "Cannot get layout of forward declarations!" from RecordLayoutBuilder.cpp:2782
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chandlerc@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>david.majnemer@gmail.com, dblaikie@gmail.com, tfiala@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Steps to reproduce on Linux x86-64 (sorry this is huge):
1) Checkout LLVM. I was at r216571, but I doubt it was that specific.
2) Build 'llc' with a modern Clang host compiler in a boring CMake/Ninja
'debug' build ('-g' is the debug symbol option).
3) Grab this input to llc into a file (it's some code from Bullet):
% cat t.ll
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
%btTransform = type { %btMatrix3x3, %btVector3 }
%btMatrix3x3 = type { [3 x %btVector3] }
%btVector3 = type { [4 x float] }
define void @_ZN7RagDollC2EP15btDynamicsWorldRK9btVector3f() unnamed_addr
noreturn uwtable ssp align 2 {
%localA = alloca %btTransform, align 4
%m_basis.i = getelementptr inbounds %btTransform* %localA, i64 0, i32 0
%call5.i = call float @sinx() nounwind
%mul20.i = fmul float %call5.i, fmul (float undef, float undef)
%sub21.i = fsub float %mul20.i, undef
%arrayidx.i1.i.i = getelementptr inbounds %btMatrix3x3* %m_basis.i, i64 0,
i32 0, i64 1, i32 0, i64 0
%1 = bitcast float* %arrayidx.i1.i.i to <4 x float>*
%2 = insertelement <2 x float> undef, float %sub21.i, i32 0
%3 = insertelement <2 x float> %2, float 0.000000e+00, i32 1
%4 = shufflevector <2 x float> <float undef, float 0.000000e+00>, <2 x float>
%3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
store <4 x float> %4, <4 x float>* %1, align 4
%m_basis.i1 = getelementptr inbounds %btTransform* %localA, i64 0, i32 0
%arrayidx5.i.i.i.i = getelementptr inbounds %btMatrix3x3* %m_basis.i1, i64 0,
i32 0, i64 0, i32 0, i64 2
%5 = bitcast float* %arrayidx5.i.i.i.i to i8*
call void @llvm.memset.p0i8.i64(i8* %5, i8 0, i64 16, i32 4, i1 false)
nounwind
ret void
}
declare float @sinx() nounwind readnone
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
3) Run the built llc binary under lldb as follows:
% lldb -- path/to/llc -o - t.ll -mcpu=x86-64
-x86-experimental-vector-shuffle-lowering -debug
(lldb) target create "./bin/llc"
Current executable set to './bin/llc' (x86_64).
(lldb) settings set -- target.run-args "-o" "-" "t.ll" "-mcpu=x86-64"
"-x86-experimental-vector-shuffle-lowering" "-debug"
(lldb) b X86ISelLowering.cpp:6798
Breakpoint 1: where =
llc`llvm::X86TargetLowering::LowerBUILD_VECTOR(llvm::SDValue,
llvm::SelectionDAG&) const + 6447 at X86ISelLowering.cpp:6798, address =
0x0000000000f89c5f
(lldb) r
Process 16367 launching
Process 16367 stopped
* thread #1: tid = 16367, 0x00007ffff7ddb2d0, name = 'llc', stop reason = trace
frame #0: 0x00007ffff7ddb2d0
error: No such process
Process 16367 launched: './bin/llc' (x86_64)
Args: ./bin/llc -o - t.ll -mcpu=x86-64
-x86-experimental-vector-shuffle-lowering -debug
Features:+64bit,+sse2
CPU:x86-64
<snip>
Legalizing: 0x2a2d1e0: v4f32 = BUILD_VECTOR 0x2a2add0, 0x2a2d0d8, 0x2a2b0e8,
0x2a2d0d8 [ORD=11] [ID=23]
Process 16367 stopped
* thread #1: tid = 16367, 0x0000000000f89c5f
llc`llvm::X86TargetLowering::LowerBUILD_VECTOR(this=0x00000000029cfef0,
Op=SDValue at 0x00007fffffffbcd8, DAG=0x00000000029fa010) const + 6447 at
X86ISelLowering.cpp:6798, name = 'llc', stop reason = breakpoint 1.1
frame #0: 0x0000000000f89c5f
llc`llvm::X86TargetLowering::LowerBUILD_VECTOR(this=0x00000000029cfef0,
Op=SDValue at 0x00007fffffffbcd8, DAG=0x00000000029fa010) const + 6447 at
X86ISelLowering.cpp:6798
6795
6796 // Turn it into a shuffle of zero and zero-extended scalar to
vector.
6797 Item = getShuffleVectorZeroOrUndef(Item, 0, NumZero > 0,
Subtarget, DAG);
-> 6798 SmallVector<int, 8> MaskVec;
6799 for (unsigned i = 0; i != NumElems; ++i)
6800 MaskVec.push_back(i == Idx ? 0 : 1);
6801 return DAG.getVectorShuffle(VT, dl, Item, DAG.getUNDEF(VT),
&MaskVec[0]);
(lldb) p Item->dumpr()
lldb: ../tools/clang/lib/AST/RecordLayoutBuilder.cpp:2782: const
clang::ASTRecordLayout &clang::ASTContext::getASTRecordLayout(const
clang::RecordDecl *) const: Assertion `D && "Cannot get layout of forward
declarations!"' failed.
zsh: abort (core dumped) lldb -- ./bin/llc -o - t.ll -mcpu=x86-64 -debug
Since this might well be a matter of LLDB and Clang disagreeing about how much
debug information should be emitted, CC-ing folks that work on the debug info
side of things as well.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>