-
Notifications
You must be signed in to change notification settings - Fork 50
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
assertion with 64-bit division #45
Comments
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
pub unsafe extern "C" fn __aeabi_uldivmod() {
asm!(
"push {{r4, lr}}",
"sub sp, sp, #16",
"add r4, sp, #8",
"str r4, [sp]",
"bl __udivmoddi4",
"ldr r2, [sp, #8]",
"ldr r3, [sp, #12]",
"add sp, sp, #16",
"pop {{r4, pc}}",
options(noreturn)
);
} |
LLVM-IR:
I know -Zemit-stack-sizes (LLVM's stack-sizes feature) ignores all inline assembly when computing the stack usage of a function -- we already warn about this other places like So I guess the issue here is that stack-sizes also ignores the naked attribute so it considers this function to be a normal, empty function that uses a few bytes of stack -- even though no extra machine code is generated around the inline I think in general we should identify the (It would have been nice if they had written these subroutines with |
Ah, I wouldn't have expected that. I would've thought that the stack size analysis runs on MIR. The proposed solution sounds good though! |
Source code
Error message
Machine code
The text was updated successfully, but these errors were encountered: