Skip to content
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

x86 C ABI struct return does not work on windows/mac for structs < 8 bytes #5745

Closed
brson opened this issue Apr 5, 2013 · 4 comments
Closed
Labels
A-codegen Area: Code generation O-macos Operating system: macOS O-windows Operating system: Windows

Comments

@brson
Copy link
Contributor

brson commented Apr 5, 2013

C returns the structs packed into %eax but our code appears to load the fields from %al and %dl for byte fields.

See run-pass/extern-return-TwoU8s and run-pass/extern-return-TwoU16s.

@brson
Copy link
Contributor Author

brson commented Apr 18, 2013

Mac appears to follow the same ABI as windows here.

@pnkfelix
Copy link
Member

visiting for bug traige, 2013-08-26.

Nominating for maturity milestone 3: Feature Complete.

@pnkfelix
Copy link
Member

accepted for feature complete

@nikomatsakis
Copy link
Contributor

Those test cases work now (I fixed this as part of my extern fn work)

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 14, 2020
clone_on_copy - add machine applicability

Fix rust-lang#4826.
Change the applicability of the lint clone_on_copy. Split a test file and run rustfix on the clone_on_copy part.

changelog: clone_on_copy - add machine applicability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation O-macos Operating system: macOS O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

3 participants