-
Notifications
You must be signed in to change notification settings - Fork 13k
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
The x86_64 extern "C" fn ABIs is wrong when packed structs are involved #115667
Comments
rustc think x86_64 uses indirect pass mode for packed structs, but actual not. Pass mode cast:
Passed by integer register with packed layout:
|
That's defining a global variable named struct P
{
char i;
float f;
} __attribute__((__packed__)); The x86-64 psABI says
Since the field |
@lukas-code Oops, my mistake. After seeing this, I mistakenly thought that |
I tried this code:
t.rs:
t.c:
run:
I expected to see this happen:
Instead, this happened:
Meta
rustc --version --verbose
:Link: #115609
The text was updated successfully, but these errors were encountered: