rust/compiler/rustc_codegen_gcc/src
bors 327c7ee436 Auto merge of #133099 - RalfJung:forbidden-hardfloat-features, r=workingjubilee
forbid toggling x87 and fpregs on hard-float targets

Part of https://github.com/rust-lang/rust/issues/116344, follow-up to https://github.com/rust-lang/rust/pull/129884:

The `x87`  target feature on x86 and the `fpregs` target feature on ARM must not be disabled on a hardfloat target, as that would change the float ABI. However, *enabling* `fpregs` on ARM is [explicitly requested](https://github.com/rust-lang/rust/issues/130988) as it seems to be useful. Therefore, we need to refine the distinction of "forbidden" target features and "allowed" target features: all (un)stable target features can determine on a per-target basis whether they should be allowed to be toggled or not. `fpregs` then checks whether the current target has the `soft-float` feature, and if yes, `fpregs` is permitted -- otherwise, it is not. (Same for `x87` on x86).

Also fixes https://github.com/rust-lang/rust/issues/132351. Since `fpregs` and `x87` can be enabled on some builds and disabled on others, it would make sense that one can query it via `cfg`. Therefore, I made them behave in `cfg` like any other unstable target feature.

The first commit prepares the infrastructure, but does not change behavior. The second commit then wires up `fpregs` and `x87` with that new infrastructure.

r? `@workingjubilee`
2024-12-13 19:43:00 +00:00
..
back Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
intrinsic Add simd_relaxed_fma intrinsic 2024-11-23 14:39:42 -05:00
abi.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
allocator.rs Replace -Z default-hidden-visibility with -Z default-visibility 2024-10-01 22:32:13 +10:00
asm.rs codegen #[naked] functions using global_asm! 2024-12-10 21:41:03 +01:00
attributes.rs codegen_ssa: consolidate tied feature checking 2024-09-24 15:48:49 +01:00
base.rs Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-update 2024-09-27 22:00:17 +02:00
builder.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
callee.rs Effects cleanup 2024-10-26 10:19:07 +08:00
common.rs cg_gcc: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
consts.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
context.rs rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973) 2024-12-02 01:14:40 +07:00
coverageinfo.rs Unbox and unwrap the contents of StatementKind::Coverage 2024-03-23 22:05:11 +11:00
debuginfo.rs When the required discriminator value exceeds LLVM's limits, drop the debug info for the function instead of panicking. 2024-11-19 05:19:09 -08:00
declare.rs Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-update 2024-09-27 22:00:17 +02:00
errors.rs generalize 'forbidden feature' concept so that even (un)stable feature can be invalid to toggle 2024-12-11 22:11:15 +01:00
gcc_util.rs apply review feedback 2024-12-11 22:18:51 +01:00
int.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
lib.rs generalize 'forbidden feature' concept so that even (un)stable feature can be invalid to toggle 2024-12-11 22:11:15 +01:00
mono_item.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
type_.rs Rename supertraits of CodegenMethods. 2024-09-17 10:24:43 +10:00
type_of.rs cg_gcc: rustc_abi::Abi => BackendRepr 2024-10-29 15:01:01 -07:00