Several platforms still have incorrectly aligned u128
/i128
#128950
Labels
A-ABI
Area: Concerning the application binary interface (ABI)
A-FFI
Area: Foreign function interface (FFI)
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
O-MIPS
Target: MIPS processors
O-PowerPC
Target: PowerPC processors
O-SPARC
Target: SPARC processors
S-waiting-on-LLVM
Status: the compiler-dragon is eepy, can someone get it some tea?
T-compiler
Relevant to the compiler team, which will review and decide on the PR/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: