Thanks again to Open Source Security, inc and Embecosm for their ongoing support for this project.
Milestone Progress
One major change the compiler saw this week was the integration of Faisal Abbas’ constant evaluation work! This PR marks a huge step towards our Const generics milestone and allows us to perform function evaluation, conditional blocks, arithmetics or even calls to builtin functions in constant contexts! This is the culmination of months of work and we are extremely proud of Faisal. Congratulations!
We now need to add more constant folding test cases and stress the implementation out in multiple ways. This will hopefully expose bugs that Faisal will be able to fix as the remaining part of his project.
Philip also took the time to send out our initial compiler patches to the gcc-patches
mailing list. We are looking forward to the reviews and feedback!
As a reminder, we will be present at the Linux Plumbers Conference, Kangrejos and GNU Cauldron in September. Feel free to come and say hi!
Completed Activities
- Add missing language selection for rs6000 PR1512
- rustc_attrs: Allow `rustc_inherit_overflow_checks` as a builtin attribute PR1510
- constexpr: Fix warning in sorry fmt string PR1509
- Desugar double borrows into two HIR:BorrowExpr’s PR1507
- Fix up missing jump_target handling PR1504
- Fix port of NOP_EXPR PR1501
- Remove missed target hooks code PR1500
- Constant folding in gccrs: port over rest of the code from CP frontend PR1499
- Merge from GCC upstream PR1498
- Refactor our casts to follow the Rustc implemention PR1497
- Fix ICE in dyn impl block PR1493
- Improve AST dump PR1473
Contributors this week
Overall Task Status
Category | Last Week | This Week | Delta |
TODO | 167 | 168 | +1 |
In Progress | 30 | 28 | -2 |
Completed | 445 | 452 | +7 |
Test Cases
Category | Last Week | This Week | Delta |
Passing | 6675 | 6732 | +56 |
Failed | – | – | – |
XFAIL | 51 | 51 | – |
XPASS | – | – | – |
Bugs
Category | Last Week | This Week | Delta |
TODO | 52 | 52 | – |
In Progress | 17 | 16 | -1 |
Completed | 193 | 199 | +6 |
Milestone Progress
Milestone | Last Week | This Week | Delta | Start Date | Completion Date | Target |
Data Structures 1 – Core | 100% | 100% | – | 30th Nov 2020 | 27th Jan 2021 | 29th Jan 2021 |
Control Flow 1 – Core | 100% | 100% | – | 28th Jan 2021 | 10th Feb 2021 | 26th Feb 2021 |
Data Structures 2 – Generics | 100% | 100% | – | 11th Feb 2021 | 14th May 2021 | 28th May 2021 |
Data Structures 3 – Traits | 100% | 100% | – | 20th May 2021 | 17th Sept 2021 | 27th Aug 2021 |
Control Flow 2 – Pattern Matching | 100% | 100% | – | 20th Sept 2021 | 9th Dec 2021 | 29th Nov 2021 |
Macros and cfg expansion | 100 | 100% | – | 1st Dec 2021 | 31st Mar 2022 | 28th Mar 2022 |
Imports and Visibility | 100% | 100% | – | 29th Mar 2022 | 13th Jul 2022 | 27th May 2022 |
Const Generics | 60% | 74% | ++14% | 30th May 2022 | – | 17th Oct 2022 |
Intrinsics | 0% | 15% | +15% | 6th Sept 2022 | – | 14th Nov 2022 |
Risks
Risk | Impact (1-3) | Likelihood (0-10) | Risk (I * L) | Mitigation |
Rust Language Changes | 2 | 7 | 14 | Target specific Rustc version for first go |
Missing GCC 13 upstream window | 1 | 6 | 6 | Merge in GCC 14 and be proactive about reviews |
Planned Activities
- Prepare our talks for the three upcoming conferences we’ll attend
Detailed changelog
Const evaluation
As we mentioned, we merged Faisal Abbas GSoC 2022 project which now allows us to do constant evaluation of expressions and function calls within the front-end. This is akin to C++ constexpr and enforces constant expressions do not allocate. Below is an example test case of what this allows us to do. Here you can see we have a constant function and inside the main function we can see that the gimple we are feeding the GCC middle-end has already evaluated this function to a value. Note this is the behaviour regardless of optimisation level.
const A: i32 = 1;
const fn test(a: i32) -> i32 {
let b = A + a;
if b == 2 {
return b + 2;
}
a
}
const B: i32 = test(1);
const C: i32 = test(12);
fn main() {
// { dg-final { scan-tree-dump-times {a = 1} 1 gimple } }
let a = A;
// { dg-final { scan-tree-dump-times {b = 4} 1 gimple } }
let b = B;
// { dg-final { scan-tree-dump-times {c = 12} 1 gimple } }
let c = C;
}