about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
AgeCommit message (Collapse)AuthorLines
2024-07-28Update compiler_builtins to 0.1.114Nicholas Bishop-1/+8
The `weak-intrinsics` feature was removed from compiler_builtins in https://github.com/rust-lang/compiler-builtins/pull/598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In https://github.com/rust-lang/compiler-builtins/pull/593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-80/+69
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28stabilize `is_sorted`Slanterns-1/+1
2024-07-17Format cg_gcc with same formatting parametersGuillaume Gomez-54/+18
2024-07-17Align cg_gcc rustfmt.toml with rust'sGuillaume Gomez-0/+2
2024-07-16Rollup merge of #124033 - bjorn3:ar_archive_writer_0_3_0, r=davidtwcoTrevor Gross-2/+2
Sync ar_archive_writer to LLVM 18.1.3 From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-11Remove lang feature for type ascriptionMichael Goulet-1/+1
2024-07-10Update `Cargo.lock` and remove duplicated implGuillaume Gomez-10/+6
2024-07-10Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into masterGuillaume Gomez-1137/+2684
2024-07-07Sync ar_archive_writer to LLVM 18.1.3bjorn3-2/+2
From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-04Auto merge of #123781 - RalfJung:miri-fn-identity, r=oli-obkbors-1/+1
Miri function identity hack: account for possible inlining Having a non-lifetime generic is not the only reason a function can be duplicated. Another possibility is that the function may be eligible for cross-crate inlining. So also take into account the inlining attribute in this Miri hack for function pointer identity. That said, `cross_crate_inlinable` will still sometimes return true even for `inline(never)` functions: - when they are `DefKind::Ctor(..) | DefKind::Closure` -- I assume those cannot be `InlineAttr::Never` anyway? - when `cross_crate_inline_threshold == InliningThreshold::Always` so maybe this is still not quite the right criterion to use for function pointer identity.
2024-07-02Fix spansMichael Goulet-2/+2
2024-07-02Give Instance::expect_resolve a spanMichael Goulet-0/+1
2024-07-02Miri function identity hack: account for possible inliningRalf Jung-1/+1
2024-06-21Remove type_i1 and type_struct from cg_ssabjorn3-25/+25
They are not representable by Cranelift
2024-06-21Remove check_overflow method from MiscMethodsbjorn3-8/+0
It can be retrieved from the Session too.
2024-06-21Remove const_bitcast from ConstMethodsbjorn3-13/+13
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+1
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-06-18Remove redundant argument from `subdiagnostic` methodOli Scherer-1/+1
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-22/+20
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-10ScalarInt: size mismatches are a bug, do not delay the panicRalf Jung-1/+1
2024-06-01Uplift TypeRelation and RelateMichael Goulet-1/+1
2024-05-23Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3Guillaume Gomez-1/+5
rustc_codegen_llvm: add support for writing summary bitcode Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area. I talked some to `@teresajohnson` about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world. Per `@dtolnay,` you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-05-23rustc_codegen_gcc: fix changed method signatureAugie Fackler-1/+1
2024-05-22rustc_codegen_llvm: add support for writing summary bitcodeAugie Fackler-0/+4
Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area. I talked some to @teresajohnson about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world. Per @dtolnay, you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-05-22Stop using `to_hir_binop` in codegenScott McMurray-6/+7
2024-05-17Rename Unsafe to SafetySantiago Pastorino-8/+4
2024-05-10Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgrbors-6/+3
Rollup of 5 pull requests Successful merges: - #124615 (coverage: Further simplify extraction of mapping info from MIR) - #124778 (Fix parse error message for meta items) - #124797 (Refactor float `Primitive`s to a separate `Float` type) - #124888 (Migrate `run-make/rustdoc-output-path` to rmake) - #124957 (Make `Ty::builtin_deref` just return a `Ty`) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-10Rollup merge of #124797 - beetrees:primitive-float, r=davidtwcoMatthias Krüger-6/+3
Refactor float `Primitive`s to a separate `Float` type Now there are 4 of them, it makes sense to refactor `F16`, `F32`, `F64` and `F128` out of `Primitive` and into a separate `Float` type (like integers already are). This allows patterns like `F16 | F32 | F64 | F128` to be simplified into `Float(_)`, and is consistent with `ty::FloatTy`. As a side effect, this PR also makes the `Ty::primitive_size` method work with `f16` and `f128`. Tracking issue: #116909 `@rustbot` label +F-f16_and_f128
2024-05-09codegen: memmove/memset cannot be non-temporalRalf Jung-9/+4
2024-05-08Simplify `use crate::rustc_foo::bar` occurrences.Nicholas Nethercote-4/+3
They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.)
2024-05-06Refactor float `Primitive`s to a separate `Float` typebeetrees-6/+3
2024-05-03Auto merge of #123441 - saethlin:fixed-len-file-names, r=oli-obkbors-2/+3
Stabilize the size of incr comp object file names The current implementation does not produce stable-length paths, and we create the paths in a way that makes our allocation behavior is nondeterministic. I think `@eddyb` fixed a number of other cases like this in the past, and this PR fixes another one. Whether that actually matters I have no idea, but we still have bimodal behavior in rustc-perf and the non-uniformity in `find` and `ls` was bothering me. I've also removed the truncation of the mangled CGU names. Before this PR incr comp paths look like this: ``` target/debug/incremental/scratch-38izrrq90cex7/s-gux6gz0ow8-1ph76gg-ewe1xj434l26w9up5bedsojpd/261xgo1oqnd90ry5.o ``` And after, they look like this: ``` target/debug/incremental/scratch-035omutqbfkbw/s-gux6borni0-16r3v1j-6n64tmwqzchtgqzwwim5amuga/55v2re42sztc8je9bva6g8ft3.o ``` On the one hand, I'm sure this will break some people's builds because they're on Windows and only a few bytes from the path length limit. But if we're that seriously worried about the length of our file names, I have some other ideas on how to make them smaller. And last time I deleted some hash truncations from the compiler, there was a huge drop in the number if incremental compilation ICEs that were reported: https://github.com/rust-lang/rust/pull/110367https://github.com/rust-lang/rust/pull/110367 --- Upon further reading, this PR actually fixes a bug. This comment says the CGU names are supposed to be a fixed-length hash, and before this PR they aren't: https://github.com/rust-lang/rust/blob/ca7d34efa94afe271accf2bd3d44152a5bd6fff1/compiler/rustc_monomorphize/src/partitioning.rs#L445-L448
2024-05-02Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmeaseMatthias Krüger-2/+2
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)` I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
2024-05-02Inline & delete `Ty::new_unit`, since it's just a field accessWaffle Lapkin-2/+2
2024-05-01Step bootstrap cfgsMark Rousskov-2/+0
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-2/+2
And suggest adding the `#[coroutine]` to the closure
2024-04-24Auto merge of #122053 - erikdesjardins:alloca, r=nikicbors-13/+7
Stop using LLVM struct types for alloca The alloca type has no semantic meaning, only the size (and alignment, but we specify it explicitly) matter. Using `[N x i8]` is a more direct way to specify that we want `N` bytes, and avoids relying on LLVM's struct layout. It is likely that a future LLVM version will change to an untyped alloca representation. Split out from #121577. r? `@ghost`
2024-04-23Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyoMatthias Krüger-4/+5
Dellvmize some intrinsics (use `u32` instead of `Self` in some integer intrinsics) This implements https://github.com/rust-lang/compiler-team/issues/693 minus what was implemented in #123226. Note: I decided to _not_ change `shl`/... builder methods, as it just doesn't seem worth it. r? ``@scottmcm``
2024-04-22Stabilize the size of incr comp object file namesBen Kimock-2/+3
2024-04-20Rollup merge of #123967 - RalfJung:static_mut_refs, r=Nilstrieb许杰友 Jieyou Xu (Joe)-4/+2
static_mut_refs: use raw pointers to remove the remaining FIXME Using `SyncUnsafeCell` would not make a lot of sense IMO.
2024-04-20Fixup `rustc_codegen_gcc` test signatureMaybe Waffle-4/+5
2024-04-19Auto merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiserbors-2/+14
Introduce perma-unstable `wasm-c-abi` flag Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it. This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`. Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide. This is a companion PR to #117918, but they could be merged independently. MCP: https://github.com/rust-lang/compiler-team/issues/703 Tracking issue: https://github.com/rust-lang/rust/issues/122532
2024-04-15static_mut_refs: use raw pointers to remove the remaining FIXMERalf Jung-4/+2
2024-04-12restore location in gcc alloca codegenErik Desjardins-1/+7
2024-04-11use [N x i8] for alloca typesErik Desjardins-19/+7
2024-04-11Put `PlaceValue` into `OperandValue::Ref`, rather than 3 tuple fieldsScott McMurray-6/+12
2024-04-11Make `PlaceRef` hold a `PlaceValue` for the non-layout fields (like ↵Scott McMurray-18/+18
`OperandRef` does)
2024-04-06Save/restore more items in cache with incremental compilationMichael Baikov-0/+2
2024-04-05Rollup merge of #122334 - GuillaumeGomez:vendor-cg_gcc, r=Mark-SimulacrumGuillaume Gomez-5/+7
Vendor rustc_codegen_gcc I used https://github.com/rust-lang/rust/pull/115274 as base for this update. r? `@bjorn3`