Landing: 6c171ef2c1ba
Project / Subsystem
gcc / gcc/optimization
Date
2026-07-08
Author
Konstantinos Eleftheriou
Commit
6c171ef2c1ba0b71505f1c6e93c8d3c8d90bdaca
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/optimization
- patch_id
- —
- commit_hash
- 6c171ef2c1ba0b71505f1c6e93c8d3c8d90bdaca
- source_type
- github
- headline
- forwprop: Add long-multiply two-carry variant
- tldr
- Improves long-multiply optimization by recognizing and folding a 'two-carry' variant with separate cross-sum and low-half carry propagations.
- author
- Konstantinos Eleftheriou
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gcc
- • optimization
- • forwprop
- • long-multiply
- • two-carry
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-08T00:00:00.000Z
This commit extends the forwprop optimization pass to recognize a ‘two-carry’ variant of long multiplication. In this variant, the cross sum and the low-half accumulation each generate a separate unsigned overflow compare, contributing to the final result. The optimization now correctly folds this pattern, including an extra check to validate the carry operands against the canonical multiplication operands. This addresses PR tree-optimization/107090 by enabling the compiler to optimize these complex multiplication sequences.