GCC Front-End For Rust

Alternative Rust Compiler for GCC

View the Project on GitHub

June 2024 Monthly report

Overview

Thanks again to Open Source Security, inc and Embecosm for their ongoing support for this project.

Project update

All of our GSoC students are progressing nicely on their projects. Jasmine Tang has worked her inline assembly nodes through almost all of the passes of our pipeline, and is now working on lowering them to GCC’s inline assembly representation. The rustc testsuite adapter tool, whose development is lead by Muhammad Mahad, is starting to be usable for converting rusttest testcases to the dejagnu format, and we are expecting the integration of some rustc testcases to our testsuite shortly. Finally, Kushal Pal’s error reporting for borrow-checking errors is moving along nicely - we are currently dealing with transmitting data between the Rust polonius engine and our C++ compiler, which is a complex task with lots of edge cases.

The milestones for GCC 14.2 and 15.1 are completed, and we are now waiting on reviews for the patches sent upstream. We are hoping to get our documentation-related patches merged in time for 14.2, and will get in touch with the release managers to address this matter. In other technical news, we have started working on the milestones related to for loops handling and are making good progress. Work continues on the name resolution rework, which we aim to complete in order to handle core 1.49 properly.

Finally, gccrs will be attending two international Rust conferences this year, with Arthur being present at RustConf and Pierre-Emmanuel attending EuroRust. We are looking forward to meeting with the community once again, and to talk about compilers for way too long :)

Community call

We will have our next monthly community call on the 8th of July at 9am UTC. You can subscribe to our calendar to see when the next one will be held. The call is open to everyone, even if you would just like to sit-in and listen. You can also subscribe to our mailing-list or join our Zulip chat to be notified of upcoming events.

Call for contribution

Our error propagation expressions (expressions which use the question mark operator, of the form <expr>?) are currently forgotten in many of our AST visitors. As a result, there are unexpected cases when it comes to various parts of the compiler pipeline handling them. In that particular case, the function call’s generic arguments are not disambiguated - the compiler does not know if it needs to be handling a generic type, or a const generic value. You will need to add handling to our name resolution pass for these error propagation expressions. It would be helpful to look at the current generic disambiguation to start figuring out where it is called from, and where you need to call it.

The #[may_dangle] attribute is an important part of core 1.49, as it is used in many Drop implementations of complex Rust standard types. However, the usage of this attribute is complex, and has certain consequences on the borrow-checker and drop-checker, two integral parts of the Rust compiler pipeline. Because of this, its use is restricted to unsafe trait implementations, which is a behavior we aim to reproduce in gccrs. Have a look at our UnsafeChecker compiler pass to see what you will need to modify. You can read about the #[may_dangle] attribute here.

Completed Activities

Contributors this month

Overall Task Status

Category Last Month This Month Delta
TODO 333 340 +7
In Progress 71 70 -1
Completed 836 846 +10

Test Cases

TestCases Last Month This Month Delta
Passing 8507 8543 +36
Failed - - -
XFAIL 69 72 +3
XPASS - - -

Bugs

Category Last Month This Month Delta
TODO 126 127 +1
In Progress 40 38 -2
Completed 414 419 +5

Milestones Progress

For the GCC 14.2 milestone, the work has been completed and submitted upstream - we are just waiting on reviews and on approval for merging into the 14.2 branch.

Milestone Last Month This Month Delta Start Date Completion Date Target Target GCC
GCC 14.2 0% 100% +100% 7th Jun 2024 15th Jun 2024 15th Jun 2024 GCC 14.2
GCC 15.1 0% 100% +100% 21st Jun 2024 31st Jun 2024 1st Jul 2024 GCC 15.1
Name resolution 2.0 rework 0% 6% +6% 1st Jun 2024 - 1st Apr 2025 GCC 15.1
Macro expansion 0% 7% +7% 1st Jun 2024 - 1st Jan 2025 GCC 15.1
Unhandled attributes 0% 80% +80% 1st Jul 2024 - 15th Aug 2024 GCC 15.1
Lang items 0% 0% - 1st Jul 2024 - 1st Sep 2024 GCC 15.1
Upcoming Milestone Last Month This Month Delta Start Date Completion Date Target Target GCC
Indexing fixes 0% 0% - 21st Jul 2024 - 15th Sep 2024 GCC 15.1
Iterator fixes 0% 0% - 21st Jul 2024 - 15th Sep 2024 GCC 15.1
Auto traits improvements 0% 0% - 15th Sep 2024 - 21st Oct 2024 GCC 15.1
Deref and DerefMut improvements 0% 0% - 28th Sep 2024 - 28th Oct 2024 GCC 15.1
Remaining typecheck issues 0% 0% - 21st Oct 2024 - 1st Jan 2025 GCC 15.1
cfg-core 0% 0% - 1st Dec 2024 - 1st Jan 2025 GCC 15.1
Question mark operator 0% 0% - 15th Dec 2024 - 21st Feb 2025 GCC 15.1
Codegen fixes 0% 0% - 7th Oct 2024 - 1st Mar 2025 GCC 15.1
Specialization 0% 0% - 1st Jan 2025 - 1st Mar 2025 GCC 15.1
Inline assembly 0% 0% - 1st Jun 2024 - 15th Sep 2024 GCC 15.1
Borrow checker improvements 0% 0% - 1st Jun 2024 - 15th Sep 2024 GCC 15.1
Rustc Testsuite Adaptor 0% 0% - 1st Jun 2024 - 15th Sep 2024 GCC 15.1
blackbox intrinsic 0% 0% - 28th Oct 2024 - 28th Nov 2024 GCC 15.1
Unstable RfL features 0% 0% - 7th Jan 2025 - 1st Mar 2025 GCC 15.1
cfg-rfl 0% 0% - 7th Jan 2025 - 15th Feb 2025 GCC 15.1
alloc parser issues 0% 100% +100% 7th Jan 2025 31st Jun 2024 28th Jan 2025 GCC 15.1
let-else 0% 0% - 28th Jan 2025 - 28th Feb 2025 GCC 15.1
Explicit generics with impl Trait 0% 0% - 28th Feb 2025 - 28th Mar 2025 GCC 15.1
offsetof!() builtin macro 0% 0% - 15th Mar 2025 - 15th May 2025 GCC 15.1
Generic Associated Types 0% 0% - 15th Mar 2025 - 15th Jun 2025 GCC 16.1
RfL const generics 0% 0% - 1st May 2025 - 15th Jun 2025 GCC 16.1
frontend plugin hooks 0% 0% - 15th May 2025 - 7th Jul 2025 GCC 16.1
Handling the testsuite issues 0% 0% - 15th Sep 2024 - 15th Sep 2025 GCC 16.1
std parser issues 0% 100% +100% 7th Jan 2025 31st Jun 2024 28th Jan 2025 GCC 16.1
main shim 0% 0% - 28th Jul 2025 - 15th Sep 2025 GCC 16.1
Past Milestone Last Month This Month Delta Start Date Completion Date Target Target GCC
Data Structures 1 - Core 100% 100% - 30th Nov 2020 27th Jan 2021 29th Jan 2021 GCC 14.1
Control Flow 1 - Core 100% 100% - 28th Jan 2021 10th Feb 2021 26th Feb 2021 GCC 14.1
Data Structures 2 - Generics 100% 100% - 11th Feb 2021 14th May 2021 28th May 2021 GCC 14.1
Data Structures 3 - Traits 100% 100% - 20th May 2021 17th Sep 2021 27th Aug 2021 GCC 14.1
Control Flow 2 - Pattern Matching 100% 100% - 20th Sep 2021 9th Dec 2021 29th Nov 2021 GCC 14.1
Macros and cfg expansion 100% 100% - 1st Dec 2021 31st Mar 2022 28th Mar 2022 GCC 14.1
Imports and Visibility 100% 100% - 29th Mar 2022 13th Jul 2022 27th May 2022 GCC 14.1
Const Generics 100% 100% - 30th May 2022 10th Oct 2022 17th Oct 2022 GCC 14.1
Initial upstream patches 100% 100% - 10th Oct 2022 13th Nov 2022 13th Nov 2022 GCC 14.1
Upstream initial patchset 100% 100% - 13th Nov 2022 13th Dec 2022 19th Dec 2022 GCC 14.1
Update GCC’s master branch 100% 100% - 1st Jan 2023 21st Feb 2023 3rd Mar 2023 GCC 14.1
Final set of upstream patches 100% 100% - 16th Nov 2022 1st May 2023 30th Apr 2023 GCC 14.1
Borrow Checking 1 100% 100% - TBD 8th Jan 2024 15th Aug 2023 GCC 14.1
Procedural Macros 1 100% 100% - 13th Apr 2023 6th Aug 2023 6th Aug 2023 GCC 14.1
GCC 13.2 Release 100% 100% - 13th Apr 2023 22nd Jul 2023 15th Jul 2023 GCC 14.1
GCC 14 Stage 3 100% 100% - 1st Sep 2023 20th Sep 2023 1st Nov 2023 GCC 14.1
GCC 14.1 Release 100% 100% - 2nd Jan 2024 2nd Jun 2024 15th Apr 2024 GCC 14.1
formatargs!() support 100% 100% - 15th Feb 2024 - 1st Apr 2024 GCC 14.1

Planned Activities

Risks

There have been no changes to the Risk table this month

Risk Impact (1-3) Likelihood (0-10) Risk (I * L) Mitigation
Missing features for GCC 15.1 deadline 2 1 2 Start working on required features as early as July (6mo ahead)

Detailed changelog