-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Several platforms still have incorrectly aligned u128
/i128
#128950
Comments
@rustbot label +A-abi +A-ffi +A-llvm +T-compiler |
For reference: https://godbolt.org/z/jvrxv7jP7 |
Align i128s to 16 bytes, following the example at https://reviews.llvm.org/D86310. clang already does this implicitly, but do it in backend code too for the benefit of other frontends (see e.g #102783 & rust-lang/rust#128950).
Align i128s to 16 bytes, following the example at https://reviews.llvm.org/D86310. clang already does this implicitly, but do it in backend code too for the benefit of other frontends (see e.g llvm/llvm-project#102783 & rust-lang/rust#128950).
Align i128s to 16 bytes, following the example at https://reviews.llvm.org/D86310. clang already does this implicitly, but do it in backend code too for the benefit of other frontends (see e.g llvm/llvm-project#102783 & rust-lang/rust#128950).
Align i128s to 16 bytes, following the example at https://reviews.llvm.org/D86310. clang already does this implicitly, but do it in backend code too for the benefit of other frontends (see e.g llvm#102783 & rust-lang/rust#128950).
Fixed in LLVM 20. @rustbot label +llvm-fixed-upstream |
We still need to change the data-layout on the rustc side. |
What else is left to do for this issue? |
Windows has an issue with its |
This issue is just waiting on LLVM 20 now. Regarding the Windows issue: I'm guessing your referring to rust-lang/lang-team#255 (comment)? It's not really the same issue as this (alignment mismatch vs return ABI mismatch), so it seems better to open a separate |
Right, I forgot we are waiting on a LLVM upgrade. Regarding Windows, Wesley thinks that Clang is in the wrong here on the MSVC targets https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/MSVC.20.60f16.60.20and.20.60f128.60.20ABI/near/480542167. |
Opened #134288 for the Windows issue. |
I tried this code:
I expected to see this happen: The printed alignment to match the alignment used for
__int128_t
by GCC and Clang.Instead, this happened: On 64-bit PowerPC, 64-bit SPARC and 64-bit MIPS, Rust thinks the alignment is 8 whereas GCC and Clang think the alignment is 16. The PowerPC 64-bit ABI specifications (both ELFv1 and ELFv2) agree with GCC and Clang (I'm not aware of any specification for 128-bit integers on SPARC64 or MIPS64, but GCC/Clang's behaviour seems to be the de-facto standard). This is because the LLVM data layout for the affected platforms doesn't correctly specify the alignment. This is the same as #54341 but on different architectures (cc rust-lang/lang-team#255). I initially discovered this when running abi-cafe on PowerPC64 to test #128643. I've filed an LLVM bug at llvm/llvm-project#102783.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: