Skip to content

Update GCC backend subtree #142669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 66 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
d52b5e6
Merge commit '6ba33f5e1189a5ae58fb96ce3546e76b13d090f5' into subtree-…
GuillaumeGomez May 14, 2025
3cec08a
Update gcc version used in rustc_codegen_version
GuillaumeGomez May 14, 2025
f064896
Add missing `add_eval` to generate `__rdl_oom` in the alloc error han…
GuillaumeGomez May 16, 2025
7cc33be
Merge pull request #676 from GuillaumeGomez/rdl_room
antoyo May 16, 2025
f36e8f5
Remove rustc_attr_data_structures re-export from rustc_attr_parsing
mejrs May 18, 2025
e58e697
Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin
Zalathar May 19, 2025
82160c4
Changes to constant handling - faster deduplication, more compact rep…
FractalFir May 20, 2025
3d962df
Merge pull request #680 from FractalFir/master
antoyo May 21, 2025
90a007c
Add spell checking job in the CI
antoyo May 21, 2025
c430b87
Fix typos
antoyo May 21, 2025
9aec231
Merge pull request #681 from rust-lang/test/typos
antoyo May 21, 2025
721ac5a
Merge branch 'master' into sync_from_rust_2025_05_21
antoyo May 21, 2025
ce3dae9
Update to nightly-2025-05-21
antoyo May 21, 2025
593d7ca
Implement missing f16/f128 builtins
antoyo May 22, 2025
dca28e5
Only specify that we have reliable f16 and f128 on targets where thos…
antoyo May 22, 2025
dd6d5e2
Fix f128 intrinsics
antoyo May 22, 2025
f1d5cfe
Skip the core test f16::test_total_cmp because it fails in debug mode…
antoyo May 24, 2025
1afdb55
Fix to 128 bit int unaligned loads
FractalFir May 23, 2025
d80802b
Merge pull request #684 from FractalFir/master
antoyo May 27, 2025
d098c8a
modifed y.sh to allow for running cargo tests.
FractalFir May 9, 2025
22ca124
Added support for easy fuzzing with rustlantis
FractalFir May 28, 2025
ea03697
Removed some env vars from the CI
FractalFir May 28, 2025
967fc29
Merge pull request #688 from FractalFir/fuzz_support
antoyo May 28, 2025
706905b
Merge pull request #669 from FractalFir/y_cargo_tests
antoyo May 28, 2025
ac69f1e
Pin compiler_builtins to 0.1.160 to fix some f128 tests
antoyo May 30, 2025
267f94e
Added some bare-bones support for explict registers in ARM inline ass…
FractalFir Jun 2, 2025
ba53d97
Fix cast from u128 to f128
antoyo Jun 2, 2025
8efeb49
Merge pull request #682 from rust-lang/sync_from_rust_2025_05_21
antoyo Jun 2, 2025
ac500d4
Merge pull request #692 from FractalFir/arm_asm
antoyo Jun 2, 2025
659d996
Changed intrinsic generation
FractalFir Jun 3, 2025
6fbac93
Regenerated intrinsics
FractalFir Jun 3, 2025
e4c9584
Apply suggestions from code review
FractalFir Jun 3, 2025
f518ec5
Merge pull request #687 from FractalFir/better_intrinsics
antoyo Jun 3, 2025
ddf0ba2
Use `Command::exec` to run `rustc`/`cargo` commands to ensure that if…
GuillaumeGomez Jun 6, 2025
aa95fcd
Add support for automatically reducing found fuzz cases.
FractalFir Jun 7, 2025
d14a49d
Add documentation about why we use `exec`
GuillaumeGomez Jun 8, 2025
485e43f
Merge pull request #698 from GuillaumeGomez/signal
antoyo Jun 8, 2025
96e9fbf
Fix sysroot Cargo.lock
antoyo Jun 10, 2025
bb3ee76
Temporarily ignore the test u128-as-f32 to merge the fix of the sysro…
antoyo Jun 10, 2025
b15114f
Merge pull request #702 from rust-lang/reenable-stdarch-test
antoyo Jun 10, 2025
45e23b2
Use `tempfile::TempDir::keep()` instead of deprecated `into_path()`
emmanuel-ferdman Jun 11, 2025
acfb046
Merge pull request #706 from emmanuel-ferdman/master
antoyo Jun 11, 2025
e3d4805
Improved reduction by adding support for removign dead functions. Fix…
FractalFir Jun 8, 2025
b4be0b9
Merge pull request #700 from FractalFir/fuzz_support
antoyo Jun 12, 2025
72d99d0
Add cspell config
antoyo Jun 13, 2025
2abdea9
Fix spelling mistakes or ignore spell checking some parts of code
antoyo Jun 13, 2025
323432a
Add the cspell action in the CI
antoyo Jun 13, 2025
640c067
Merge pull request #707 from rust-lang/spell-check
antoyo Jun 13, 2025
3f1e473
Remove tests that pass
antoyo Jun 13, 2025
efc8815
Fix to make the test zst_no_llvm_alloc pass
antoyo Jun 13, 2025
1e96d86
Merge pull request #708 from rust-lang/tests/remove-passing-tests
antoyo Jun 13, 2025
3812cf4
Reenable run-make tests
antoyo Jun 13, 2025
033fa35
Fix for run-make tests
antoyo Jun 13, 2025
3f09406
Add patch to fix a run-make test
antoyo Jun 14, 2025
5bd2c80
Fix for tests/run-make/no-builtins-attribute
antoyo Jun 14, 2025
735a6d3
Switch to gcc-14 by default to fix some run-make tests
antoyo Jun 14, 2025
82d7cd4
Merge pull request #709 from rust-lang/reenable-run-make-tests
antoyo Jun 14, 2025
9848c66
Fix warnings
GuillaumeGomez Jun 16, 2025
05af962
Fix warnings when not using the `master` feature
GuillaumeGomez Jun 16, 2025
46c14b7
Run clippy correctly, run it on `build_system` as well and run it ear…
GuillaumeGomez Jun 16, 2025
fec46a4
Fix clippy lints
GuillaumeGomez Jun 16, 2025
bbcc84a
Update tempfile dependency
GuillaumeGomez Jun 16, 2025
8392a00
Make the `tempfile` version in `Cargo.toml` matches the one in `Cargo…
GuillaumeGomez Jun 16, 2025
fda0bb9
Merge pull request #713 from GuillaumeGomez/fix-warnings
antoyo Jun 16, 2025
c48d8d4
Merge commit 'fda0bb9588912a3e0606e880ca9f6e913cf8a5a4' into subtree-…
GuillaumeGomez Jun 18, 2025
8648405
GCC backend: Remove `add_eval` if no function is created
GuillaumeGomez Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions compiler/rustc_codegen_gcc/.cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"allowCompoundWords": true,
"dictionaries": ["cpp", "rust-extra", "rustc_codegen_gcc"],
"dictionaryDefinitions": [
{
"name": "rust-extra",
"path": "tools/cspell_dicts/rust.txt",
"addWords": true
},
{
"name": "rustc_codegen_gcc",
"path": "tools/cspell_dicts/rustc_codegen_gcc.txt",
"addWords": true
}
],
"files": [
"src/**/*.rs"
],
"ignorePaths": [
"src/intrinsic/archs.rs",
"src/intrinsic/llvm.rs"
],
"ignoreRegExpList": [
"/(FIXME|NOTE|TODO)\\([^)]+\\)/",
"__builtin_\\w*"
]
}
43 changes: 29 additions & 14 deletions compiler/rustc_codegen_gcc/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:
env:
# Enable backtraces for easier debugging
RUST_BACKTRACE: 1
# For the run-make tests.
LLVM_BIN_DIR: /usr/bin

jobs:
build:
Expand Down Expand Up @@ -48,7 +50,7 @@ jobs:

- name: Install packages
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
run: sudo apt-get install ninja-build ripgrep llvm-14-tools llvm

- name: Install rustfmt & clippy
run: rustup component add rustfmt clippy
Expand All @@ -61,11 +63,15 @@ jobs:
sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }}
echo 'gcc-path = "/usr/lib/"' > config.toml

# Some run-make tests fail if we use our forked GCC because it doesn't
# bundle libstdc++, so we switch to gcc-14 to have a GCC that has
# libstdc++.
- name: Set default GCC to gcc-14
run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 30

- name: Set env
run: |
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV

#- name: Cache rust repository
## We only clone the rust repository for rustc tests
Expand All @@ -76,12 +82,22 @@ jobs:
#path: rust
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}

- name: Prepare
run: ./y.sh prepare --only-libcore

- name: Check formatting
run: ./y.sh fmt --check

- name: clippy
run: |
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --no-default-features -- -D warnings
cargo clippy --manifest-path build_system/Cargo.toml --all-targets -- -D warnings

- name: Build
run: |
./y.sh prepare --only-libcore
./y.sh build --sysroot
./y.sh test --mini-tests
cargo test
./y.sh test --cargo-tests

- name: Run y.sh cargo build
run: |
Expand All @@ -101,20 +117,19 @@ jobs:
run: |
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }}

- name: Check formatting
run: ./y.sh fmt --check

- name: clippy
run: |
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features master -- -D warnings

duplicates:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: python tools/check_intrinsics_duplicates.py

spell_check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@v1.32.0
- uses: streetsidesoftware/cspell-action@v7

build_system:
runs-on: ubuntu-24.04
steps:
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
run: |
sudo dpkg --force-overwrite -i gcc-15.deb
echo 'gcc-path = "/usr/lib"' > config.toml
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV



- name: Set env
run: |
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_gcc/.github/workflows/m68k.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
- name: Set env
run: |
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV



#- name: Cache rust repository
## We only clone the rust repository for rustc tests
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
./y.sh prepare --only-libcore --cross
./y.sh build --sysroot --features compiler_builtins/no-f16-f128 --target-triple m68k-unknown-linux-gnu
./y.sh test --mini-tests
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu cargo test
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu ./y.sh test --cargo-tests
./y.sh clean all

- name: Prepare dependencies
Expand Down
16 changes: 11 additions & 5 deletions compiler/rustc_codegen_gcc/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:
env:
# Enable backtraces for easier debugging
RUST_BACKTRACE: 1
# For the run-make tests.
LLVM_BIN_DIR: /usr/bin

jobs:
build:
Expand All @@ -36,7 +38,8 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Install packages
run: sudo apt-get install ninja-build ripgrep
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for run-make tests.
run: sudo apt-get install ninja-build ripgrep llvm-14-tools llvm

- name: Download artifact
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/gcc-15.deb
Expand All @@ -46,18 +49,21 @@ jobs:
sudo dpkg --force-overwrite -i gcc-15.deb
echo 'gcc-path = "/usr/lib/"' > config.toml
# Some run-make tests fail if we use our forked GCC because it doesn't
# bundle libstdc++, so we switch to gcc-14 to have a GCC that has
# libstdc++.
- name: Set default GCC to gcc-14
run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 30

- name: Set env
run: |
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
- name: Build
run: |
./y.sh prepare --only-libcore
EMBED_LTO_BITCODE=1 ./y.sh build --sysroot --release --release-sysroot
./y.sh test --mini-tests
cargo test
./y.sh test --cargo-tests
./y.sh clean all
- name: Prepare dependencies
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/.github/workflows/stdarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
if: ${{ !matrix.cargo_runner }}
run: |
./y.sh test --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore
cargo test
./y.sh test --cargo-tests

- name: Run stdarch tests
if: ${{ !matrix.cargo_runner }}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_gcc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ tools/llvmint-2
llvm
build_system/target
config.toml
build
build
rustlantis
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To run specific tests, use appropriate flags such as:

- `./y.sh test --test-libcore`
- `./y.sh test --std-tests`
- `cargo test -- <name of test>`
- `./y.sh test --cargo-tests -- <name of test>`

Additionally, you can run the tests of `libgccjit`:

Expand Down
50 changes: 43 additions & 7 deletions compiler/rustc_codegen_gcc/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ dependencies = [
"unicode-width",
]

[[package]]
name = "getrandom"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi",
]

[[package]]
name = "hermit-abi"
version = "0.3.1"
Expand Down Expand Up @@ -111,9 +123,9 @@ checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d"

[[package]]
name = "linux-raw-sys"
version = "0.4.14"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"

[[package]]
name = "memchr"
Expand All @@ -137,6 +149,12 @@ version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"

[[package]]
name = "r-efi"
version = "5.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"

[[package]]
name = "regex"
version = "1.8.4"
Expand Down Expand Up @@ -166,9 +184,9 @@ dependencies = [

[[package]]
name = "rustix"
version = "0.38.42"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85"
checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
dependencies = [
"bitflags",
"errno",
Expand All @@ -188,12 +206,12 @@ dependencies = [

[[package]]
name = "tempfile"
version = "3.14.0"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
dependencies = [
"cfg-if",
"fastrand",
"getrandom",
"once_cell",
"rustix",
"windows-sys",
Expand Down Expand Up @@ -242,6 +260,15 @@ dependencies = [
"winapi-util",
]

[[package]]
name = "wasi"
version = "0.14.2+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
dependencies = [
"wit-bindgen-rt",
]

[[package]]
name = "winapi"
version = "0.3.9"
Expand Down Expand Up @@ -345,3 +372,12 @@ name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"

[[package]]
name = "wit-bindgen-rt"
version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
dependencies = [
"bitflags",
]
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ gccjit = "2.7"
[dev-dependencies]
boml = "0.3.1"
lang_tester = "0.8.0"
tempfile = "3.7.1"
tempfile = "3.20"

[profile.dev]
# By compiling dependencies with optimizations, performing tests gets much faster.
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_codegen_gcc/_typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[default.extend-words]
ba = "ba"
hsa = "hsa"
olt = "olt"
seh = "seh"
typ = "typ"

[files]
extend-exclude = ["src/intrinsic/archs.rs"]
Loading
Loading