[llvm-bugs] [Bug 37897] New: [PostRA Machine Sink] Ensure dbg value consistency when moving dbg instructions across other dbg instructions.
llvm-bugs at lists.llvm.org
Thu Jun 21 11:23:32 PDT 2018
Bug ID: 37897
Summary: [PostRA Machine Sink] Ensure dbg value consistency
when moving dbg instructions across other dbg
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: matthew.davis at sony.com
CC: llvm-bugs at lists.llvm.org
A discussion in https://reviews.llvm.org/D45637 mentions a possible
inconsistent debug representation when sinking debug-info instructions across
other debug-info instructions associated to the same user variable. I'll try
to distill the issue below, but the review provides a more detailed discussion.
While we have not yet seen such a case occur from user source code, it seems
that such a case might occur. To better illustrate this idea, the following
example was ripped from the link referenced above:
renamable $eax = COPY $edi
DBG_VALUE debug-use $eax, debug-use $noreg, !14, !DIExpression(),
$esi = ADD $edi, 7
DBG_VALUE debug-use $esi, debug-use $noreg, !14, !DIExpression(),
In this hypothetical example, both DBG_VALUEs are associated with some user
variable !14. If the MachineSink code were to sink the COPY and its associated
DBG_VALUE to some successor block, not displayed in the example above, then
there is the potential that a debugger will show incorrect data (old/original
debug data) when stepping pass the sunken instruction.
Another similar example, also ripped from the review is the following:
if (p == NULL)
b = 1;
p = q;
Represented as IR:
call dbg.value(!DIVariable("p", ...), null, !DIExpression(DW_OP_constu 0))
%b = predicated_move(%p, i32 1) // assuming such an instruction exists :-)
%p.1 = %q
call dbg.value(!DIVariable("p", ...), %p.1, !DIExpression()
In this example, moving the original dbg_value after the second would have the
effect of making variable 'p' appear NULL when stepping/inspecting instructions
after the second dbg.intrinsic.
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs