-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
RISCV32 codegen: small struct passed by value incorrectly (?) #4741
Comments
In RISC-V ABI
ldc2 passes As I understand ABI, such structures (size less than XLEN) should be passed through the register |
Only the CI-tested x86[_64] and AArch64 ABIs are working (i.e., compatible with C, and DMD's custom x86 ABI); there's a 64-bit RISC-V implementation in https://github.com/ldc-developers/ldc/blob/master/gen/abi/riscv64.cpp, but I have no idea about its quality. The C[++] interop tests coverage in the DMD testsuite is pretty good, but needs cross-compiling and running them on actual hardware or in an emulator. |
(I don't know how to provide a demo. Do we have some kind of test environment for riscv32? Any ideas?)
ldc2 compiler flags is used:
Code:
ldc2 versions: 1.40.0-beta2 and 1.39.0
The text was updated successfully, but these errors were encountered: