Landing: 8ff8114e4448

Project / Subsystem

gcc / tree-optimization

Date

2026-08-18

Author

Richard Biener

Commit

8ff8114e4448307f27e38fbdb98028283ab64f1c

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
8ff8114e4448307f27e38fbdb98028283ab64f1c
source_type
github
headline
Fix crash in loop IV optimization due to missed folding
tldr
Avoid a crash in loop IV optimization when simplifying an induction variable candidate to zero.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • loop
  • • crashfix
discussion_id_link
—
bugzilla_pr
—
date
2026-08-18T00:00:00.000Z

This commit addresses a crash in the loop invariant code (IVOPTs) optimization pass. Previously, if a simplification of an induction variable candidate resulted in a zero step, the Scalar Evolution (SCEV) analysis might still consider it an IV with a zero step. This change prevents a crash by handling cases where the IV is invariant.