Landing: 52ceb1698c9f

Project / Subsystem

gcc / gcc/tree-optimization

Date

2026-09-12

Author

Shivam Gupta

Commit

52ceb1698c9f46be900fe3719c2967fe74bcd1f7

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/tree-optimization
patch_id
—
commit_hash
52ceb1698c9f46be900fe3719c2967fe74bcd1f7
source_type
github
headline
Handle undefined ranges in CLZ loop optimization.
tldr
Fixes loop optimization for CLZ by correctly handling undefined ranges.
author
Shivam Gupta
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • tree-optimization
  • • CLZ
  • • loop optimization
discussion_id_link
—
bugzilla_pr
—
date
2026-09-12T00:00:00.000Z

The optimization that converts signed right-shift loops into Count Leading Zeros (CLZ) operations previously mishandled undefined ranges. When determining the number of loop iterations, the Ranger analysis could return an undefined range, which was then incorrectly treated as a valid non-negative range. This change adds explicit checks for undefined ranges, preventing incorrect optimization.