[PATCH] D120168: [Debuginfo][LSR][NFC] Add support for salvaging variadic dbg.value intrinsics [1/2]
Chris Jackson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 05:59:19 PST 2022
chrisjackson added a comment.
In D120168#3363344 <https://reviews.llvm.org/D120168#3363344>, @Orlando wrote:
> The change SGTM but I found a reproducer that causes clang to crash when this patch is applied:
>
> $ cat reduce.cpp
> #include <utility>
> template <typename a> class Vec {
> public:
> void push(a);
> };
> void d(int argc, char **argv) {
> Vec<std::pair<char *, unsigned>> e;
> for (int f = 0;;)
> for (; f < argc; ++f)
> e.push(std::make_pair(argv[f], f));
> }
>
> $ clang++ -O2 -g reduce.cpp
>
> /home/och/dev/llvm/llvm-project/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h:139: llvm::DbgValueLoc::DbgValueLoc(const llvm::DIExpression*, llvm::ArrayRef<llvm::DbgValueLocEntry>, bool): Assertion `Expr && Expr->isValid() && is_contained(Expr->getElements(), dwarf::DW_OP_stack_value)' failed.
> ...
Oops, looks like when I split my patch into two I failed to restore some critical code. Sometimes LSR itself modifies the number of location ops in a dbg.value. If scev-based salvaging is to attempt recovery it must first restore the dbg.value to a single-op state by removing the DIArglist in the first argument. I will restore the code.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120168/new/
https://reviews.llvm.org/D120168
More information about the llvm-commits
mailing list