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

C ABI for small tags is incorrect #7142

Open
bhansconnect opened this issue Oct 6, 2024 · 0 comments
Open

C ABI for small tags is incorrect #7142

bhansconnect opened this issue Oct 6, 2024 · 0 comments
Labels
bug Something isn't working code gen Generating machine code intermediate issue Likely good for someone who has completed a few other issues llvm

Comments

@bhansconnect
Copy link
Contributor

If a tag is small, The c-abi has us pass multiple values in a single register. This really happens with any aggregate.

For example Task U8 {} should be passed to the platform in a single register. Roc is always passing it in two registers as if it was a larger type.

Read this full thread for real context: https://roc.zulipchat.com/#narrow/stream/395097-compiler-development/topic/tags.20and.20c.20abi

Also this repo and commit should be a relatively small repro: https://github.com/jared-cone/roc-zig/tree/c72f6d79063302f18c9dcd9cc8747d0e7ce97117

@bhansconnect bhansconnect added bug Something isn't working code gen Generating machine code llvm intermediate issue Likely good for someone who has completed a few other issues labels Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code gen Generating machine code intermediate issue Likely good for someone who has completed a few other issues llvm
Projects
None yet
Development

No branches or pull requests

1 participant