[PATCH] D66284: [DebugInfo] Avoid crash from dropped fragments in LiveDebugValues

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 03:08:14 PDT 2019


jmorse created this revision.
jmorse added reviewers: aprantl, vsk, wolfgangp.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
jmorse added a child revision: D65368: [DebugInfo] LiveDebugValues: Don't drop fragment information when restoring spills.

This patch is spun out of D65368 <https://reviews.llvm.org/D65368>, and purely aims to avoid a crash caused by DW_OP_LLVM_fragments being dropped from DIExpressions by LiveDebugValues spill-restore code. There are two hunks:

- On spill restore, use fragment information from the spilt-location-expression, avoiding a later assertion failure
- When spilling, don't spill any DBG_VALUE with a complex expression, as it can't be safely restored and will definitely lead to an incorrect variable location

The additional function in live-debug-values-restore.mir triggers an assertion failure on a unpatched x86_64 Debug build of LLVM, on Ubuntu 18. This crash will be in LLVM-9 too, so the intention is to cherry pick it there.


Repository:
  rL LLVM

https://reviews.llvm.org/D66284

Files:
  lib/CodeGen/LiveDebugValues.cpp
  test/DebugInfo/MIR/X86/live-debug-values-restore.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66284.215349.patch
Type: text/x-patch
Size: 9117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190815/8e9ecfb6/attachment.bin>


More information about the llvm-commits mailing list