-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusCall for partcipation: This issues needs some investigation to determine current statusO-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-debuggingWorking group: Bad Rust debugging experiencesWorking group: Bad Rust debugging experiences
Description
This test does not work on aarch64: https://github.com/rust-lang/rust/blob/c9bd03cb724e13cca96ad320733046cbdb16fbbe/tests/debuginfo/by-value-non-immediate-argument.rs
Stripped down (a bit):
fn by_val_enum(x: (usize, usize, usize)) {
zzz(); // #break
}
fn main() {
by_val_enum((usize::MAX, usize::MAX, usize::MAX));
}
fn zzz() { }
Set a breakpoint on line 2 and try to print x
. gdb says it is optimized out. This can be reproduced even with -Zmir-opt-level=0
, and doesn't reproduce on x86_64. If the argument is Option<(usize, usize)>
, gdb will try to read from address 0x0.
I'm not sure if this is a rustc bug or a gdb bug because if I add any use of the non-immediate argument inside the function, we gain some instructions that look like a function prelude, and gdb is able to print the argument. https://godbolt.org/z/GeGxE7ExE
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusCall for partcipation: This issues needs some investigation to determine current statusO-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-debuggingWorking group: Bad Rust debugging experiencesWorking group: Bad Rust debugging experiences