Landing: bbc2517fe413

Project / Subsystem

gcc / match/fold

Date

2026-08-11

Author

Andrea Pinski

Commit

bbc2517fe41307a8ce21ca9b96d6660e1e842abf

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match/fold
patch_id
—
commit_hash
bbc2517fe41307a8ce21ca9b96d6660e1e842abf
source_type
github
headline
match/fold: Add LT/GT/LE/GE to combine_comparisons
tldr
The `combine_comparisons` function now supports less-than, greater-than, less-than-or-equal, and greater-than-or-equal operations.
author
Andrea Pinski
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • pattern matching
  • • boolean logic
discussion_id_link
—
bugzilla_pr
—
date
2026-08-11T00:00:00.000Z

The combine_comparisons function in GCC’s fold-const.cc has been extended to support the LT, GT, LE, and GE comparison operators. This enhancement, along with a corresponding update in match.pd to use these new capabilities, simplifies the generation of code involving boolean logic and comparisons. It is expected to facilitate better support for phiopt and ifcombine optimizations, particularly for expressions like a > b which can be represented as a & !b.