<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 - Faulty inserted DBG_VALUE by LiveDebugVariables when the DBG_VALUE is last use in virtual register live range"
href="https://bugs.llvm.org/show_bug.cgi?id=34788">34788</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Faulty inserted DBG_VALUE by LiveDebugVariables when the DBG_VALUE is last use in virtual register live range
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>karl-johan.karlsson@ericsson.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=19214" name="attach_19214" title="llc -start-before=greedy -stop-after=livedebugvars foo.mir -o -">attachment 19214</a> <a href="attachment.cgi?id=19214&action=edit" title="llc -start-before=greedy -stop-after=livedebugvars foo.mir -o -">[details]</a></span>
llc -start-before=greedy -stop-after=livedebugvars foo.mir -o -
Consider the following mir as input to greedy:
bb.0.entry:
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead
%eflags, implicit %rsp, debug-location !14
dead %eax = MOV32r0 implicit-def dead %eflags, implicit-def %al,
debug-location !14
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit killed %al,
implicit-def %rsp, implicit-def %eax, debug-location !14
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags,
implicit %rsp, debug-location !14
%2 = COPY killed %eax, debug-location !14
DBG_VALUE debug-use %2, debug-use _, !11, !DIExpression(), debug-location
!15
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead
%eflags, implicit %rsp, debug-location !16
dead %eax = MOV32r0 implicit-def dead %eflags, implicit-def %al,
debug-location !16
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit killed %al,
implicit-def %rsp, implicit-def %eax, debug-location !16
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags,
implicit %rsp, debug-location !16
%3 = COPY killed %eax, debug-location !16
DBG_VALUE debug-use %3, debug-use _, !13, !DIExpression(), debug-location
!17
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead
%eflags, implicit %rsp, debug-location !18
%edi = COPY %2, debug-location !18
%esi = COPY %3, debug-location !18
CALL64pcrel32 @usevals, csr_64, implicit %rsp, implicit killed %edi,
implicit killed %esi, implicit-def %rsp, debug-location !18
DBG_VALUE debug-use %3, debug-use _, !11, !DIExpression(), debug-location
!15
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags,
implicit %rsp, debug-location !18
RET 0, debug-location !19
After the livedebugvariables pass have reinserted DBG_VALUEs (after greedy) it
look like this:
bb.0.entry:
liveins: %rbx
frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp,
debug-location !14
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbx, -16
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags,
implicit-def %al, debug-location !14
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit %al, implicit-def
%rsp, implicit-def %eax, debug-location !14
%ebx = MOV32rr %eax, debug-location !14
DBG_VALUE debug-use %ebx, debug-use _, !11, !DIExpression(), debug-location
!15
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags,
implicit-def %al, debug-location !16
CALL64pcrel32 @getval, csr_64, implicit %rsp, implicit %al, implicit-def
%rsp, implicit-def %eax, debug-location !16
DBG_VALUE debug-use %eax, debug-use _, !13, !DIExpression(), debug-location
!17
%edi = MOV32rr killed %ebx, debug-location !18
%esi = MOV32rr killed %eax, debug-location !18
CALL64pcrel32 @usevals, csr_64, implicit %rsp, implicit killed %edi,
implicit killed %esi, implicit-def %rsp, debug-location !18
DBG_VALUE debug-use %eax, debug-use _, !11, !DIExpression(), debug-location
!15
%rbx = POP64r implicit-def %rsp, implicit %rsp, debug-location !19
RETQ debug-location !19
The last DBG_VALUE is wrong:
DBG_VALUE debug-use %eax, debug-use _, !11, !DIExpression(), debug-location !15
The value in EAX do not necessarily contain any value connected to the variable
the DBG_VALUE is suppose to describe as the range ended before the call to
usevals. The register allocator might have reused EAX for another value.</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>