OSDN Git Service

Stop undef fragments from closing non-overlapping fragments
authorDavid Stenberg <david.stenberg@ericsson.com>
Tue, 28 May 2019 13:23:25 +0000 (13:23 +0000)
committerDavid Stenberg <david.stenberg@ericsson.com>
Tue, 28 May 2019 13:23:25 +0000 (13:23 +0000)
commitef2f407ef9701ea9d6033ad0853211904b16c8e4
treec427acca2cce00f10ef7310910bdbe561b27dc1d
parentec764aad9f5561e62d725c4c845b40616c9e9278
Stop undef fragments from closing non-overlapping fragments

Summary:
When DwarfDebug::buildLocationList() encountered an undef debug value,
it would truncate all open values, regardless if they were overlapping or
not. This patch fixes so that it only does that for overlapping fragments.

This change unearthed a bug that I had introduced in D57511,
which I have fixed in this patch. The code in DebugHandlerBase that
changes labels for parameter debug values could break DwarfDebug's
assumption that the labels for the entries in the debug value history
are monotonically increasing. Before this patch, that bug could result
in location list entries whose ending address was lower than the
beginning address, and with the changes for undef debug values that this
patch introduces it could trigger an assertion, due to attempting to
emit location list entries with empty ranges. A reproducer for the bug
is added in param-reg-const-mix.mir.

Reviewers: aprantl, jmorse, probinson

Reviewed By: aprantl

Subscribers: javed.absar, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D62379

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361820 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/MIR/ARM/param-reg-const-mix.mir [new file with mode: 0644]
test/DebugInfo/X86/undef-fragment.ll [new file with mode: 0644]