about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
AgeCommit message (Collapse)AuthorLines
2024-01-10Rename `{create,emit}_warning` as `{create,emit}_warn`.Nicholas Nethercote-3/+3
For consistency with `warn`/`struct_warn`, and also `{create,emit}_err`, all of which use an abbreviated form.
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-0/+3
2024-01-05Rollup merge of #119538 - nnethercote:cleanup-errors-5, r=compiler-errorsMichael Goulet-2/+2
Cleanup error handlers: round 5 More rustc_errors cleanups. A sequel to https://github.com/rust-lang/rust/pull/119171. r? ````@compiler-errors````
2024-01-04Rollup merge of #119431 - taiki-e:asm-s390x-reg-addr, r=AmanieuMatthias Krüger-1/+4
Support reg_addr register class in s390x inline assembly In s390x, `r0` cannot be used as an address register (it is evaluated as zero in an address context). Therefore, currently, in assemblies involving memory accesses, `r0` must be [marked as clobbered](https://github.com/taiki-e/atomic-maybe-uninit/blob/1a1155653a26667396c805954ab61c8cbb14de8c/src/arch/s390x.rs#L58) or [explicitly used to a non-address](https://github.com/taiki-e/atomic-maybe-uninit/blob/1a1155653a26667396c805954ab61c8cbb14de8c/src/arch/s390x.rs#L135) or explicitly use an address register to prevent `r0` from being allocated to a register for the address. This patch adds a register class for allocating general-purpose registers, except `r0`, to make it easier to use address registers. (powerpc already has a register class (reg_nonzero) for a similar purpose.) This is identical to the `a` constraint in LLVM and GCC: https://llvm.org/docs/LangRef.html#supported-constraint-code-list > a: A 32, 64, or 128-bit integer address register (excludes R0, which in an address context evaluates as zero). https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html > a > Address register (general purpose register except r0) cc ``@uweigand`` r? ``@Amanieu``
2024-01-03Support reg_addr register class in s390x inline assemblyTaiki Endo-1/+4
2024-01-03Rename some `Diagnostic` setters.Nicholas Nethercote-2/+2
`Diagnostic` has 40 methods that return `&mut Self` and could be considered setters. Four of them have a `set_` prefix. This doesn't seem necessary for a type that implements the builder pattern. This commit removes the `set_` prefixes on those four methods.
2023-12-30Auto merge of #118705 - WaffleLapkin:codegen-atomic-exhange-untuple, r=cjgillotbors-14/+6
Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of values Doesn't change much, but a little nicer that way.
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-12-28Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of ↵Bernd Schmidt-14/+6
values
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-13/+13
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-19Add `level` arg to `into_diagnostic`.Nicholas Nethercote-5/+9
And make all hand-written `IntoDiagnostic` impls generic, by using `DiagnosticBuilder::new(dcx, level, ...)` instead of e.g. `dcx.struct_err(...)`. This means the `create_*` functions are the source of the error level. This change will let us remove `struct_diagnostic`. Note: `#[rustc_lint_diagnostics]` is added to `DiagnosticBuilder::new`, it's necessary to pass diagnostics tests now that it's used in `into_diagnostic` functions.
2023-12-18Rename many `DiagCtxt` arguments.Nicholas Nethercote-21/+21
2023-12-18Rename `CodegenContext::create_diag_handler` as `CodegenContext::create_dcx`.Nicholas Nethercote-1/+1
2023-12-18Rename `Handler` as `DiagCtxt`.Nicholas Nethercote-12/+13
2023-12-17Auto merge of #118828 - mu001999:master, r=b-naberbors-17/+0
Remove dead codes in rustc_codegen_gcc Detected by #118257
2023-12-14Move rustc_codegen_ssa target features to rustc_targetUrgau-7/+6
2023-12-13Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`.Lukasz Anforowicz-1/+1
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-11Fix rustc codegen gcc testsUrgau-1/+1
2023-12-11Remove dead codesr0cky-17/+0
2023-12-09Auto merge of #117873 - quininer:android-emutls, r=Amanieubors-0/+1
Add emulated TLS support This is a reopen of https://github.com/rust-lang/rust/pull/96317 . many android devices still only use 128 pthread keys, so using emutls can be helpful. Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls. r? `@Amanieu`
2023-12-07Auto merge of #118324 - RalfJung:ctfe-read-only-pointers, r=saethlinbors-3/+5
compile-time evaluation: detect writes through immutable pointers This has two motivations: - it unblocks https://github.com/rust-lang/rust/pull/116745 (and therefore takes a big step towards `const_mut_refs` stabilization), because we can now detect if the memory that we find in `const` can be interned as "immutable" - it would detect the UB that was uncovered in https://github.com/rust-lang/rust/pull/117905, which was caused by accidental stabilization of `copy` functions in `const` that can only be called with UB When UB is detected, we emit a future-compat warn-by-default lint. This is not a breaking change, so completely in line with [the const-UB RFC](https://rust-lang.github.io/rfcs/3016-const-ub.html), meaning we don't need t-lang FCP here. I made the lint immediately show up for dependencies since it is nearly impossible to even trigger this lint without `const_mut_refs` -- the accidentally stabilized `copy` functions are the only way this can happen, so the crates that popped up in #117905 are the only causes of such UB (in the code that crater covers), and the three cases of UB that we know about have all been fixed in their respective crates already. The way this is implemented is by making use of the fact that our interpreter is already generic over the notion of provenance. For CTFE we now use the new `CtfeProvenance` type which is conceptually an `AllocId` plus a boolean `immutable` flag (but packed for a more efficient representation). This means we can mark a pointer as immutable when it is created as a shared reference. The flag will be propagated to all pointers derived from this one. We can then check the immutable flag on each write to reject writes through immutable pointers. I just hope perf works out.
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-3/+5
is immutable
2023-12-07Allow internal_features in rustc_codegen_gcc examplesUrgau-0/+1
2023-12-07Update rustc_codegen_gcc libcUrgau-2/+2
2023-12-07Add emulated TLS supportquininer-0/+1
Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls.
2023-12-04Rename some arguments.Nicholas Nethercote-2/+2
`sess` is a terribly misleading name for a `Handler`! This confused me for a bit.
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-2/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+1
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-19Pass TyCtxt by valueAntoni Boucher-3/+3
2023-11-19Merge commit '2e8386e9fb3506cef991d04f8b3bc78f9a0c2630' into ↵Antoni Boucher-41/+104
subtree-update_cg_gcc_2023-11-17
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-12target_feature: make it more clear what that 'Option' meansRalf Jung-1/+1
2023-11-02Remove `libc` dependency in cg_gcc alloc_system exampleGuillaume Gomez-4/+14
2023-11-02Pass `--sysroot` optionGuillaume Gomez-0/+4
2023-11-02Fix config.sh scriptGuillaume Gomez-1/+1
2023-11-02Fix compilation errors in rustc_codegen_gcc examplesGuillaume Gomez-2/+2
2023-11-02Disable `master` feature by default when building rustc_codegen_gccGuillaume Gomez-1/+0
2023-10-27Merge commit '09ce29d0591a21e1abae22eac4d41ffd32993af8' into ↵Antoni Boucher-53/+98
subtree-update_cg_gcc_2023-10-25
2023-10-26Merge commit 'e4fe941b11a55c5005630696e9b6d81c65f7bd04' into ↵Antoni Boucher-507/+2664
subtree-update_cg_gcc_2023-10-25
2023-10-20s/generator/coroutine/Oli Scherer-1/+1
2023-10-20s/Generator/Coroutine/Oli Scherer-4/+4
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+2
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-10-09Use IntoDynSyncSendAntoni Boucher-6/+14
2023-10-09Fix checksAntoni Boucher-1/+1
2023-10-09Merge commit '11a0cceab966e5ff1058ddbcab5977e8a1d6d290' into ↵Antoni Boucher-657/+2836
subtree-update_cg_gcc_2023-10-09
2023-10-02Auto merge of #102099 - InnovativeInventor:re-cold-land, r=nikicbors-1/+1
Rebased: Mark drop calls in landing pads cold instead of noinline I noticed that certain inlining optimizations were missing while staring at some compiled code output. I'd like to see this relanded, so I rebased the PR from `@erikdesjardins` (PR #94823). This PR reapplies https://github.com/rust-lang/rust/pull/92419, which was reverted in https://github.com/rust-lang/rust/pull/94402 due to https://github.com/rust-lang/rust/issues/94390. Fixes https://github.com/rust-lang/rust/issues/46515, fixes https://github.com/rust-lang/rust/issues/87055. Update: fixes #97217.
2023-10-02Reapply: Mark drop calls in landing pads cold instead of noinlineErik Desjardins-1/+1
Co-authored-by: Max Fan <git@max.fan> Co-authored-by: Nikita Popov <npopov@redhat.com>
2023-10-02Auto merge of #115898 - onur-ozkan:config-change-tracking, r=Mark-Simulacrumbors-1/+1
bootstrap major change detection implementation The use of `changelog-seen` and `bootstrap/CHANGELOG.md` has not been functional in any way for many years. We often do major/breaking changes but never update the changelog file or the `changelog-seen`. This is an alternative method for tracking major or breaking changes and informing developers when such changes occur. Example output when bootstrap detects a major change: ![image](https://github.com/rust-lang/rust/assets/39852038/ee802dfa-a02b-488b-a433-f853ce079b8a)
2023-10-01implement major change tracking for the bootstrap configurationonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-22Have a single struct for queries and hookOli Scherer-3/+2