[PATCH] D62379: [DebugInfo] Stop undef fragments from closing non-overlapping fragments

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 04:49:44 PDT 2019


dstenb created this revision.
dstenb added reviewers: aprantl, jmorse, probinson.
dstenb added a project: debug-info.
Herald added subscribers: llvm-commits, javed.absar.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/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.


Repository:
  rL LLVM

https://reviews.llvm.org/D62379

Files:
  lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/DebugInfo/MIR/ARM/param-reg-const-mix.mir
  test/DebugInfo/X86/undef-fragment.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62379.201195.patch
Type: text/x-patch
Size: 11884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190524/615b79f1/attachment-0001.bin>


More information about the llvm-commits mailing list