librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64#57085
librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64#57085bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
|
I don't know anything about SPARC and have not been able to find the referenced document by some quick googling |
|
Ah, this could be a typo. It could be version "2.4.1" of the SPARC Compliance Definition, not "4.2.1". Let me check. CC @karcherm |
|
Yep, it's 2.4.1, not 4.2.1. See: http://sparc.org/technical-documents/specifications/ Let me push a fixed version. |
cd69efe to
fe0b3d1
Compare
|
Quoting page 48 from the PDF (http://sparc.org/wp-content/uploads/2014/01/SCD.2.4.1.pdf.gz):
|
fe0b3d1 to
970747e
Compare
…x-sparc64 This is in accordance with the SPARC Compliance Definition 2.4.1, Page 3P-12. It says that structs of up to 8 bytes (which applies to empty structs as well) are to be passed in one register.
970747e to
65dabd6
Compare
|
Ultimately what matters here is how clang/gcc behave here. clang crashes when provided with 0-sized arguments and gcc properly allocates the input registers for those, so... @bors r+ |
|
📌 Commit 65dabd6 has been approved by |
|
That being said, I believe that linux uses sysv on sparc(64), just like almost everywhere else, which may or may not match the vendor’s documentation at all. I only have the sysv document for 32-bit SPARC around (so can’t say much about 64-bit) and it does not appear to call out a similar requirement on my quick read-through. |
librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64 This is in accordance with the SPARC Compliance Definition 2.4.1, Page 3P-12. It says that structs of up to 8 bytes (which applies to empty structs as well) are to be passed in one register.
Rollup of 10 pull requests Successful merges: - #55470 (box: Add documentation for `From` impls) - #56242 (Add missing link in docs) - #56944 (bootstrap: Link LLVM as a dylib with ThinLTO) - #56978 (Add `std::os::fortanix_sgx` module) - #56985 (Allow testing pointers for inboundedness while forbidding dangling pointers) - #56986 (rustc: Move jemalloc from rustc_driver to rustc) - #57010 (Actually run compiletest tests on CI) - #57021 (Enable emission of alignment attrs for pointer params) - #57074 (Fix recursion limits) - #57085 (librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64) Failed merges: r? @ghost
|
☔ The latest upstream changes (presumably #57094) made this pull request unmergeable. Please resolve the merge conflicts. |
This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.