-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
DW_AT_discr_value elided in DWARF for some enum variants #104625
Comments
searched nightlies: from nightly-2022-09-01 to nightly-2022-10-01 bisected with cargo-bisect-rustc v0.6.4Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --test-dir=. --start=2022-09-01 --end=2022-10-01 That points at #94075 which seems reasonable. It looks like it we hit in humility because the enum niche optimizations were expanded in that PR. Before the PR, the optimization would only kick in for enums that had a single "dataful" variant whereas now it can apply in more cases. (I imagine the squirrely-ness of the test case also has to do with the opt kicking in or not) As for why that inhibits rust/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs Lines 379 to 382 in 911cbf8
This is a rough sketch of the layout of |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Code
There is a regression from 1.64.0 to 1.65.0 in the DWARF emitted for some variants for some enums, as the below program shows:
Version it worked on
As the comment in the program indicates, the DWARF for the
Foo
enum looks like this on 1.64.0 and earlier:rustc --version --verbose
:Version with regression
But on 1.65.0 and later, it looks like this:
rustc --version --verbose
:Unsurprisingly, there is an LLVM version bump across these two versions.
If it helps to have context about how we hit this, we saw this in the debugger (Humility) for our embedded Rust operating system (Hubris); see oxidecomputer/humility#263 for details.
Thanks in advance to anyone who looks at this -- the DWARF emitted by Rust has been invaluable for our work!
The text was updated successfully, but these errors were encountered: