You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pietroalbini opened this issue
Aug 3, 2020
· 5 comments
· Fixed by #75224
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
The debuginfo/function-arguments-naked.rs test is failing on AArch64's CI:
---- [debuginfo-gdb] debuginfo/function-arguments-naked.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
error: compilation failed!
status: signal: 6
command: "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/debuginfo/function-arguments-naked.rs" "-Zthreads=1" "--target=aarch64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/debuginfo/function-arguments-naked.gdb/a" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-g" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/debuginfo/function-arguments-naked.gdb/auxiliary"
stdout:
------------------------------------------
------------------------------------------
stderr:
------------------------------------------
warning: unused variable: `x`
--> /checkout/src/test/debuginfo/function-arguments-naked.rs:36:10
|
36 | fn naked(x: usize, y: usize) {
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `y`
--> /checkout/src/test/debuginfo/function-arguments-naked.rs:36:20
|
36 | fn naked(x: usize, y: usize) {
| ^ help: if this is intentional, prefix it with an underscore: `_y`
rustc: /checkout/src/llvm-project/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h:197: unsigned int llvm::AArch64FunctionInfo::getCalleeSavedStackSize(const llvm::MachineFrameInfo&) const: Assertion `MFI.isCalleeSavedInfoValid() && "CalleeSavedInfo not calculated"' failed.
------------------------------------------
The text was updated successfully, but these errors were encountered:
pietroalbini
added
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
O-Arm
Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
C-bug
Category: This is a bug.
labels
Aug 3, 2020
Hey ARM Group! This bug has been identified as a good "ARM candidate".
In case it's useful, here are some instructions for tackling these sorts of
bugs. Maybe take a look?
Thanks! <3
The test is causing an infinite loop due to the link register being updated during the call to zzz, that call is causing the link register to be the ret instruction after that call, the ret instruction then returns to the link register causing an infinite loop. Normally before the call the link register would be saved and then restored after the call, however due to this being a naked function that isn't happening.
The emitted LLVM IR is just calling the function and that call isn't preserving anything so this could change in a future version of LLVM I suppose.
Although with c++ and clang that code would fail to compile as you can only use asm inside a naked function. https://internals.rust-lang.org/t/idea-naked-functions-2-0/11637/25 suggests it's a bug in rustc for allowing the code to compile, @Amanieu is that still your understanding?
…ked, r=Amanieu
Don't call a function in function-arguments-naked.rs
Fixesrust-lang#75096
It's U.B. to use anything other than inline assmebling in a naked
function. Fortunately, the `#break` directive works fine without
anything in the function body.
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
The
debuginfo/function-arguments-naked.rs
test is failing on AArch64's CI:The text was updated successfully, but these errors were encountered: