<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - No DW_AT_abstract_origin emitted for a DW_TAG_lexical_block in an inlined function"
href="https://bugs.llvm.org/show_bug.cgi?id=49953">49953</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>No DW_AT_abstract_origin emitted for a DW_TAG_lexical_block in an inlined function
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tankut.baris.aktemur@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Suppose we have
__attribute__((always_inline))
static void aFunction() {
int a = 42;
if(a > 2) {
int value = a;
value += 10;
}
}
The debug info for the concrete inlined instance of this function does not
contain DW_AT_abstract_origin attributes in the DW_TAG_lexical_block
entries. E.g. the DIE of the inlined function above is
0x00000087: DW_TAG_inlined_subroutine
DW_AT_abstract_origin (0x0000002a "aFunction")
DW_AT_low_pc (0x00000000004004b2)
DW_AT_high_pc (0x00000000004004d2)
DW_AT_call_file ("/tmp/test.c")
DW_AT_call_line (11)
DW_AT_call_column (0x03)
0x0000009b: DW_TAG_variable
DW_AT_location (DW_OP_fbreg -4)
DW_AT_abstract_origin (0x00000032 "a")
0x000000a3: DW_TAG_lexical_block
DW_AT_low_pc (0x00000000004004c3)
DW_AT_high_pc (0x00000000004004d2)
0x000000b0: DW_TAG_variable
DW_AT_location (DW_OP_fbreg -8)
DW_AT_abstract_origin (0x0000003e "value")
whereas the abstract DIE is
0x0000002a: DW_TAG_subprogram
DW_AT_name ("aFunction")
DW_AT_decl_file ("/tmp/test.c")
DW_AT_decl_line (2)
DW_AT_inline (DW_INL_inlined)
0x00000032: DW_TAG_variable
DW_AT_name ("a")
DW_AT_decl_file ("/tmp/test.c")
DW_AT_decl_line (3)
DW_AT_type (0x0000004b "int")
0x0000003d: DW_TAG_lexical_block
0x0000003e: DW_TAG_variable
DW_AT_name ("value")
DW_AT_decl_file ("/tmp/test.c")
DW_AT_decl_line (5)
DW_AT_type (0x0000004b "int")
I'm not 100% sure that omitting the DW_AT_abstract_origin is a bug.
However, the DWARF 5 spec states in Section 3.3.8.2 that
A concrete instance tree may contain entries which do not correspond to
entries in the abstract instance tree to describe new entities that are
specific to
a particular inlined expansion. In that case, they will not have associated
entries in the abstract instance tree, do not contain DW_AT_abstract_origin
attributes, and must contain all their own attributes directly.
If I read this backward, I interpret that an entry without a
DW_AT_abstract_origin
attribute denotes an entry that does not exist in the abstract instance tree.
This makes me believe that Clang's behavior is a bug.
When the DW_AT_abstract_origin attribute is missing, a consumer may try
to find the corresponding abstract origin, but this may not be a bullet-proof
process in general. If Clang emitted it explicitly, the association could be
done with precision.</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>