Landing: 26aae2119eb7

Project / Subsystem

gcc / scev

Date

2026-05-12

Author

Xi Ruoyao

Commit

26aae2119eb79bfbea23b86ea1a58f9a3a0911a6

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
scev
patch_id
commit_hash
26aae2119eb79bfbea23b86ea1a58f9a3a0911a6
source_type
github
headline
Scev: Sign extend step in peeled converted IV handling [PR 125291]
tldr
GCC's scalar evolution analysis now correctly handles peeled converted induction variables by sign-extending the step.
author
Xi Ruoyao
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • scev
  • scalar evolution
  • induction variable
  • loop optimization
  • tree-optimization
discussion_id_link
github:gcc-mirror/gcc#125291
bugzilla_pr
date
2026-05-12T00:00:00.000Z

GCC’s scalar evolution (SCEV) analysis now correctly handles peeled converted induction variables (IVs) by sign-extending the step. In cases where a converted IV is peeled (unrolled a few times), the analysis could incorrectly compute the sequence of values, leading to incorrect constant propagation. Sign-extending the step ensures the analysis accurately tracks the IV’s value across iterations. This fixes PR 125291, where an unsigned char was being misinterpreted as a large positive number instead of a negative offset.