[PATCH] D73526: [SafeStack][DebugInfo] Insert DW_OP_deref in correct location
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 4 10:49:33 PST 2020
bjope added a comment.
In D73526#1857223 <https://reviews.llvm.org/D73526#1857223>, @bjope wrote:
> This broke some of our downstream tests using vla:s. Those are compiled from C and executed in gdb. What happens is that DW_OP_deref disappears and then the debugger prints the wrong value.
Oh, maybe I should have mentioned that the regression I found was related to -O1 or higher.
If I run
> llc -O1 -mtriple=x86_64-unknown-linux-gnu -o - test/DebugInfo/X86/safestack-deref.ll
then I guess I see the same regression:
Before this patch we get
.Ltmp0:
#DEBUG_VALUE: func:value <- [DW_OP_constu 8, DW_OP_minus, DW_OP_deref] $rbx
After this patch we get
.Ltmp0:
#DEBUG_VALUE: func:value <- [DW_OP_constu 8, DW_OP_minus] $rbx
So the deref has not only moved to the other side of the subtraction, it has disappeared completely.
Maybe there is some difference between FastISel and "normal" ISel here?
Btw, I agree that doing append (like the old code) also seems wrong in case the Expr isn't empty. What was the problem with doing prepend instead?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73526/new/
https://reviews.llvm.org/D73526
More information about the llvm-commits
mailing list