Landing: 097cd0ceee61

Project / Subsystem

gcc / tree-optimization

Date

2026-08-31

Author

Kyrylo Tkachov

Commit

097cd0ceee61aa4b5100931341e9c8642f060c0a

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
097cd0ceee61aa4b5100931341e9c8642f060c0a
source_type
github
headline
Tighten matching for unsigned narrow clip patterns.
tldr
Refines pattern matching for unsigned integer narrow clips to correctly handle signed comparisons and unsigned right shifts.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • compiler
discussion_id_link
—
bugzilla_pr
—
date
2026-08-31T00:00:00.000Z

This commit improves the unsigned_integer_narrow_clip pattern matching by requiring the comparison to be unsigned and the right shift to be signed. Previously, the pattern incorrectly assumed these conditions, potentially leading to incorrect transformations when a signed comparison preserved negative inputs or an unsigned right shift produced an incorrect result. The change captures both expressions and checks their result types before applying the transform, with new tests covering rejected forms.