diff options
| author | bors <bors@rust-lang.org> | 2025-04-29 02:29:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-29 02:29:56 +0000 |
| commit | 1b8ab72680f36e783af84c1a3c4f8508572bd9f9 (patch) | |
| tree | 45a5fa6de1b388f0098b401c8c4daa1727ec56c7 /compiler/rustc_codegen_gcc | |
| parent | 25cdf1f67463c9365d8d83778c933ec7480e940b (diff) | |
| parent | bf37847434acfc691553540b5bf0b8cffc09c277 (diff) | |
| download | rust-1b8ab72680f36e783af84c1a3c4f8508572bd9f9.tar.gz rust-1b8ab72680f36e783af84c1a3c4f8508572bd9f9.zip | |
Auto merge of #140415 - ChrisDenton:rollup-r0631fv, r=ChrisDenton
Rollup of 10 pull requests Successful merges: - #139308 (add autodiff inline) - #139656 (Stabilize `slice_as_chunks` library feature) - #140022 (allow deref patterns to move out of boxes) - #140276 (Do not compute type_of for impl item if impl where clauses are unsatisfied) - #140302 (Move inline asm check to typeck, properly handle aliases) - #140323 (Implement the internal feature `cfg_target_has_reliable_f16_f128`) - #140391 (Rename sub_ptr to offset_from_unsigned in docs) - #140394 (Make bootstrap git tests more self-contained) - #140396 (Workaround for windows-gnu rust-lld test failure) - #140402 (only return nested goals for `Certainty::Yes`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/gcc_util.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/lib.rs | 22 |
2 files changed, 15 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_gcc/src/gcc_util.rs b/compiler/rustc_codegen_gcc/src/gcc_util.rs index 955f9020235..2b053abdd19 100644 --- a/compiler/rustc_codegen_gcc/src/gcc_util.rs +++ b/compiler/rustc_codegen_gcc/src/gcc_util.rs @@ -55,7 +55,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri ) } else if let Some(feature) = feature.strip_prefix('-') { // FIXME: Why do we not remove implied features on "-" here? - // We do the equivalent above in `target_features_cfg`. + // We do the equivalent above in `target_config`. // See <https://github.com/rust-lang/rust/issues/134792>. all_rust_features.push((false, feature)); } else if !feature.is_empty() && diagnostics { diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs index 555f164e53f..2c5a7871683 100644 --- a/compiler/rustc_codegen_gcc/src/lib.rs +++ b/compiler/rustc_codegen_gcc/src/lib.rs @@ -102,7 +102,7 @@ use rustc_codegen_ssa::back::write::{ }; use rustc_codegen_ssa::base::codegen_crate; use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, WriteBackendMethods}; -use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen}; +use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, TargetConfig}; use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::sync::IntoDynSyncSend; use rustc_errors::DiagCtxtHandle; @@ -260,8 +260,8 @@ impl CodegenBackend for GccCodegenBackend { .join(sess) } - fn target_features_cfg(&self, sess: &Session) -> (Vec<Symbol>, Vec<Symbol>) { - target_features_cfg(sess, &self.target_info) + fn target_config(&self, sess: &Session) -> TargetConfig { + target_config(sess, &self.target_info) } } @@ -485,10 +485,7 @@ fn to_gcc_opt_level(optlevel: Option<OptLevel>) -> OptimizationLevel { } /// Returns the features that should be set in `cfg(target_feature)`. -fn target_features_cfg( - sess: &Session, - target_info: &LockedTargetInfo, -) -> (Vec<Symbol>, Vec<Symbol>) { +fn target_config(sess: &Session, target_info: &LockedTargetInfo) -> TargetConfig { // TODO(antoyo): use global_gcc_features. let f = |allow_unstable| { sess.target @@ -523,5 +520,14 @@ fn target_features_cfg( let target_features = f(false); let unstable_target_features = f(true); - (target_features, unstable_target_features) + + TargetConfig { + target_features, + unstable_target_features, + // There are no known bugs with GCC support for f16 or f128 + has_reliable_f16: true, + has_reliable_f16_math: true, + has_reliable_f128: true, + has_reliable_f128_math: true, + } } |
