-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM 5 fails debuginfo/by-value-self-argument-in-trait-impl.rs #47611
Comments
Here's the
And here it is compiled with LLVM 5 -- note the extra
|
Nice investigation @cuviper! Grepping the LLVM history may mean that llvm-mirror/llvm@ca18763 is a point of interest. |
@alexcrichton AFAICS that commit is after LLVM 5, present in the In
Which might mean that our own deref logic is out of date. |
Oh heh, good point! I actually saw that LLVM 6 was tagged with an rc today so I was kicking the tires tonight, and unfortunately this failure is still here after updating to LLVM 6. (that's how I saw it) In that case you're probably right! @eddyb or @michaelwoerister would y'all be able to help out with this? |
To test, I tried simply masking that manual deref op: diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs
index b367eb6548d0..56e545cf8c3a 100644
--- a/src/librustc_trans/mir/mod.rs
+++ b/src/librustc_trans/mir/mod.rs
@@ -492,7 +492,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
};
if let PassMode::Indirect(ref attrs) = arg.mode {
- if !attrs.contains(ArgAttribute::ByVal) {
+ if !attrs.contains(ArgAttribute::ByVal) && false {
variable_access = VariableAccess::IndirectVariable {
alloca: place.llval,
address_operations: &deref_op, This passes all debuginfo tests with LLVM 5! But (predictably) it fails on LLVM 4 and 3.9. So I guess we could add a conditional flag from rustllvm to tell us whether a manual deref should be added, depending on LLVM version. Or is there a better way to accomplish this? |
@cuviper heh I was just reading over the commit you linked (which seems like the correct diagnosis) and the rustc code and concluded to test the same thing, glad it actually works! I'd personally be fine with a "do this on LLVM 4 and below but not 5 and up" conditional (with a comment), and @michaelwoerister could do the final sign off to make sure it's not completely crazy. |
We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, but starting with [D31439] in LLVM 5, it appears that LLVM will always handle this itself. When we were still adding this manually, the resulting `.debug_loc` had too many derefs, and this failed test `debuginfo/by-value-self-argument-in-trait-impl.rs`. [D31439]: https://reviews.llvm.org/D31439 Fixes rust-lang#47611. cc @alexcrichton r? @michaelwoerister
We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, but starting with [D31439] in LLVM 5, it appears that LLVM will always handle this itself. When we were still adding this manually, the resulting `.debug_loc` had too many derefs, and this failed test `debuginfo/by-value-self-argument-in-trait-impl.rs`. [D31439]: https://reviews.llvm.org/D31439 Fixes #47611. cc @alexcrichton r? @michaelwoerister
We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM, but starting with [D31439] in LLVM 5, it appears that LLVM will always handle this itself. When we were still adding this manually, the resulting `.debug_loc` had too many derefs, and this failed test `debuginfo/by-value-self-argument-in-trait-impl.rs`. [D31439]: https://reviews.llvm.org/D31439 Fixes #47611. cc @alexcrichton r? @michaelwoerister
If I'm not mistaken, I originally added that check, and looking through the referenced LLVM commit, doing this conditionally based on the LLVM version seems fine to me. |
Thanks for the confirmation @dotdash! |
rustc
compiled with LLVM 5 fails debuginfo/by-value-self-argument-in-trait-impl.rs onx86_64-unknown-linux-gnu
. GDB fails to readself
for the following impl in the test:It's called with
(4444.5, 5555, 6666, 7777.5).method()
, and it just so happens that4444.5
transmuted to au64
is0x40b15c8000000000
, so there seems to be an indirection/deref problem in the debuginfo.Full test output:
The text was updated successfully, but these errors were encountered: