diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-06 09:27:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-06 09:27:38 +0100 |
| commit | 820ddaf67a4d1e3161249dd0dd88cf777ef47891 (patch) | |
| tree | 09c0ceb38b913620e801cf9434454db7f80203d5 /src | |
| parent | acf48426b64d24f372d534f634072de1f4c7e588 (diff) | |
| parent | 9aab517d6310223ac5a89c640723a64b695d49d2 (diff) | |
Rollup merge of #130777 - azhogin:azhogin/reg-struct-return, r=workingjubilee
rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973) Command line flag `-Zreg-struct-return` for X86 (32-bit) for rust-for-linux. This flag enables the same behavior as the `abi_return_struct_as_int` target spec key. - Tracking issue: https://github.com/rust-lang/rust/issues/116973
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/unstable-book/src/compiler-flags/reg-struct-return.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/reg-struct-return.md b/src/doc/unstable-book/src/compiler-flags/reg-struct-return.md new file mode 100644 index 00000000000..35b782f38dc --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/reg-struct-return.md @@ -0,0 +1,15 @@ +# `reg-struct-return` + +The tracking issue for this feature is: https://github.com/rust-lang/rust/issues/116973. + +------------------------ + +Option -Zreg-struct-return causes the compiler to return small structs in registers +instead of on the stack for extern "C"-like functions. +It is UNSOUND to link together crates that use different values for this flag. +It is only supported on `x86`. + +It is equivalent to [Clang]'s and [GCC]'s `-freg-struct-return`. + +[Clang]: https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-freg-struct-return +[GCC]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-freg-struct-return |
