Skip to content

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Sep 16, 2025

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Sep 16, 2025
r[asm.options.supported-options.nostack]
- `nostack`: The assembly code does not push data to the stack, or write to the stack red-zone (if supported by the target).
If this option is *not* used then the stack pointer is guaranteed to be suitably aligned (according to the target ABI) for a function call.
If this option is *not* used then the stack pointer is guaranteed by the compiler to be suitably aligned (according to the target ABI) for a function call at the start of the assembly code.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the start of the assembly code

this makes me feel weird — i suspect that inline asm isn't allowed to modify the stack pointer at all? but i'm not sure if that's true, i don't want to write it in the reference without more background info.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a requirement that the stack pointer must be restored to its original value before returning from an asm block. This applies regardless of whether nostack is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants