Tracking issue: -Zreg-struct-return
support in rustc
· Issue #116973 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
i.e. the equivalent of Clang's/GCC's -freg-struct-return
. The kernel needs it to support the x86 32-bit architecture, together with -Zregparm=3.
It could potentially be a "global target feature", i.e. a target feature that is required to be set the same way for all compilation units.
- https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-freg-struct-return
- https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-freg-struct-return
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Implementation:
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions & Answers
- Q: Should it affect the Rust ABI? It cannot be documented as doing such, because the Rust ABI is unstable, but should it do so anyways as a quality-of-implementation matter?
- Currently: We already do this for the Rust ABI implicitly, without needing a compiler flag: Tracking issue: -Zreg-struct-return support in rustc #116973 (comment)
- Q: Should it affect any other ABIs than
"C"
,"cdecl"
, and"stdcall"
?- Currently: No.
- Alternatives: It's not yet clear what ABIs this affects for gcc and clang.
- Q: Should it be accepted on any other architecture than x86_32?
- Currently: No.
- Q: Does MSVC code use this?