Landing: a97f2ef0d90d

Project / Subsystem

gcc / tree-optimization

Date

2026-07-28

Author

Richard Biener

Commit

a97f2ef0d90d46144b39a8c9ea670b52dd13233a

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
commit_hash
a97f2ef0d90d46144b39a8c9ea670b52dd13233a
source_type
github
headline
tree-optimization/126404 - Fix CTZ pattern to not break reductions
tldr
Prevents the CTZ pattern recognizer from breaking vector reduction chains by avoiding recursion on reduction patterns.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • vectorizer
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-07-28T00:00:00.000Z

A bug in the Count Trailing Zeros (CTZ) pattern recognition logic could cause it to incorrectly recurse into a temporary pattern statement. This led to the vectorizer breaking reduction chains because the setup was incomplete, resulting in multiple uses of the intermediate pattern. The fix ensures that the recognizer avoids recursing when the original pattern is part of a reduction, thus preserving the integrity of vector reductions.