2130 Commits

Author SHA1 Message Date
antoyo
feb42827f1
Merge pull request #753 from rust-lang/sync_from_rust_2025_08_25
Sync from rust 2025/08/25
2025-08-25 17:53:24 -04:00
Antoni Boucher
ad99858fd9 Set default codegen backend to gcc 2025-08-25 14:37:58 -04:00
Antoni Boucher
a53663f6b8 Update to nightly-2025-08-25 2025-08-25 12:20:57 -04:00
Antoni Boucher
02a3cae29c Merge branch 'master' into sync_from_rust_2025_08_25 2025-08-25 12:18:01 -04:00
antoyo
aac150ea99
Merge pull request #751 from rust-lang/sync_from_rust_2025_08_14
Sync from rust 2025/08/14
2025-08-14 12:35:57 -04:00
Marcelo Domínguez
e6eb521213 Complete functionality and general cleanup 2025-08-14 16:30:15 +00:00
Antoni Boucher
eff47b545a Don't set feature compiler-builtins-no-f16-f128 2025-08-14 11:46:34 -04:00
Antoni Boucher
3f476d3098 Rename/remove some UI and run-make tests 2025-08-14 11:21:22 -04:00
Antoni Boucher
26183d5741 Update to nightly-2025-08-14 2025-08-14 09:05:09 -04:00
Antoni Boucher
ec1941077b Merge branch 'master' into sync_from_rust_2025_08_14 2025-08-14 09:01:53 -04:00
antoyo
27143142de
Merge pull request #747 from GuillaumeGomez/update
Update gccjit dependency and libgccjit commit
2025-08-13 17:33:26 -04:00
Sasha Pourcelot
27beb72e87 Port the #[linkage] attribute to the new attribute system 2025-08-13 21:01:37 +02:00
antoyo
32db0c6da4
Merge pull request #748 from dvermd/fmt_tests_run
Fmt tests run
2025-08-13 10:37:20 -04:00
dvermd
dde77db2ab fix tests/run formatting 2025-08-10 08:30:33 +02:00
dvermd
307ebca295 run rustfmt on tests/run/*.rs 2025-08-10 08:30:33 +02:00
Trevor Gross
708742fb08 Rollup merge of #144192 - RalfJung:atomicrmw-ptr, r=nikic
atomicrmw on pointers: move integer-pointer cast hacks into backend

Conceptually, we want to have atomic operations on pointers of the form `fn atomic_add(ptr: *mut T, offset: usize, ...)`. However, LLVM does not directly support such operations (https://github.com/llvm/llvm-project/issues/120837), so we have to cast the `offset` to a pointer somewhere.

This PR moves that hack into the LLVM backend, so that the standard library, intrinsic, and Miri all work with the conceptual operation we actually want. Hopefully, one day LLVM will gain a way to represent these operations without integer-pointer casts, and then the hack will disappear entirely.

Cc ```@nikic``` -- this is the best we can do right now, right?
Fixes https://github.com/rust-lang/rust/issues/134617
2025-08-08 14:22:44 -05:00
Guillaume Gomez
e22a140c45 Update gccjit dependency and libgccjit commit 2025-08-08 18:08:08 +02:00
bjorn3
098d06b030 Prevent name collisions with internal implementation details
The implementation of the linkage attribute inside extern blocks defines
symbols starting with _rust_extern_with_linkage_. If someone tries to
also define this symbol you will get a symbol conflict or even an ICE.
By adding an unpredictable component to the symbol name, this becomes
less of an issue.
2025-08-07 13:41:17 +00:00
bjorn3
82aac02c52 Revert "Preserve the .debug_gdb_scripts section"
This reverts commit 868bdde25b030e0b71a29a5dbc04a891036e702e.
2025-08-06 18:01:07 +00:00
Sebastian Poeplau
2136c500cd Preserve the .debug_gdb_scripts section
Make sure that compiler and linker don't optimize the section's contents
away by adding the global holding the data to "llvm.used". The volatile
load in the main shim is retained because "llvm.used", which translates
to SHF_GNU_RETAIN on ELF targets, requires a reasonably recent linker;
emitting the volatile load ensures compatibility with older linkers, at
least when libstd is used.

Pretty printers in dylib dependencies are now emitted by the main crate
instead of the dylib; apart from matching how rlibs are handled, this
approach has the advantage that `omit_gdb_pretty_printer_section` keeps
working with dylib dependencies.
2025-08-05 10:55:07 +02:00
antoyo
f0ab82feb1
Merge pull request #373 from rust-lang/fix/m68k
Fix for m68k
2025-08-04 11:21:13 -04:00
Antoni Boucher
aa51e18ae6 Remove outdated comment 2025-08-04 10:06:57 -04:00
Antoni Boucher
1c793602ae Reenable m68k CI 2025-08-04 09:47:33 -04:00
Guillaume Gomez
c4b91bd9f8 Merge commit '482e8540a1b757ed7bccc2041c5400f051fdb01e' into subtree-update_cg_gcc_2025-08-04 2025-08-04 10:49:43 +02:00
antoyo
482e8540a1
Merge pull request #746 from rust-lang/sync_from_rust_2025_08_03
Sync from rust 2025/08/03
2025-08-03 20:18:03 -04:00
Antoni Boucher
dac1f34518 Fix stdarch patch 2025-08-03 19:57:04 -04:00
Antoni Boucher
24f1751552 Add new failing test 2025-08-03 19:30:57 -04:00
Antoni Boucher
6b363ae114 Update to nightly-2025-08-03 2025-08-03 18:58:23 -04:00
Antoni Boucher
3f48eed565 Merge branch 'master' into sync_from_rust_2025_08_03 2025-08-03 18:56:24 -04:00
antoyo
36a516d810
Merge pull request #740 from rust-lang/sync_from_rust_2025_07_21
Sync from rust 2025/07/21
2025-08-03 16:53:19 -04:00
Antoni Boucher
566c9aeb66 Fix simd_funnel_shift 2025-08-03 16:21:58 -04:00
Antoni Boucher
681651350f Only use bitcast in Builder::ret for non-native integers 2025-08-03 13:31:40 -04:00
Antoni Boucher
035ff85042 Fix intcast to use the is_signed parameter 2025-08-03 11:58:13 -04:00
Antoni Boucher
e3a6469ac0 Implement SIMD funnel shifts 2025-08-02 10:05:07 -04:00
Antoni Boucher
bc5c2229d0 Fix issues in count_leading_zeroes 2025-08-01 11:29:05 -04:00
Antoni Boucher
071606b2a3 Add failing LTO test 2025-08-01 11:01:59 -04:00
Antoni Boucher
8a2a9db29e Fix LTO errors by not adding AlwaysInline to __rust_alloc_error_handler_should_panic_v2 2025-08-01 10:40:19 -04:00
Jana Dönszelmann
f638ebcfce remove rustc_attr_data_structures 2025-07-31 14:19:27 +02:00
Stuart Cook
dcd72a62ab Rollup merge of #144232 - xacrimon:explicit-tail-call, r=WaffleLapkin
Implement support for `become` and explicit tail call codegen for the LLVM backend

This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (https://github.com/rust-lang/rust/issues/112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged.

During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
2025-07-31 15:42:00 +10:00
antoyo
2e94f54e04
Merge pull request #745 from GuillaumeGomez/regen
Regenerate intrinsics mapping
2025-07-30 10:53:31 -04:00
Guillaume Gomez
9fb99109b6 Regenerate intrinsics mapping 2025-07-30 15:45:37 +02:00
Jieyou Xu
4f8d4ca190 Update codegen_{cranelift,gcc} and opt-dist to use build.compiletest-allow-stage0 2025-07-30 19:55:07 +08:00
bjorn3
013b3eb805 Remove support for -Zcombine-cgu
Nobody seems to actually use this, while still adding some extra
complexity to the already rather complex codegen coordinator code.
It is also not supported by any backend other than the LLVM backend.
2025-07-26 13:52:24 +00:00
Joel Wejdenstål
d852f7cb12 Implement support for explicit tail calls in the MIR block builders and the LLVM codegen backend. 2025-07-26 01:02:29 +02:00
bors
a4ac1e4a09 Auto merge of #144062 - bjorn3:lto_refactors2, r=davidtwco
Various refactors to the LTO handling code (part 2)

Continuing from https://github.com/rust-lang/rust/pull/143388 this removes a bit of dead code and moves the LTO symbol export calculation from individual backends to cg_ssa.
2025-07-24 12:50:26 +00:00
Antoni Boucher
2b640216ae Fix gcc_icmp with non-native integers 2025-07-23 09:56:54 -04:00
Ralf Jung
84f834b87f atomicrmw on pointers: move integer-pointer cast hacks into backend 2025-07-23 08:32:55 +02:00
Antoni Boucher
d05542af7a Add missing cast in gcc_checked_binop 2025-07-22 13:07:12 -04:00
Antoni Boucher
d3a61f88e8 Remove failing UI test 2025-07-22 13:06:52 -04:00
Antoni Boucher
3c35d9b3eb Add missing cast in gcc_checked_binop 2025-07-22 11:44:52 -04:00