Landing: c7cfde26c966

Project / Subsystem

gcc / vect

Date

2026-07-30

Author

Christopher Bazley

Commit

c7cfde26c9669cec341b4856bb6640035236ff66

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
vect
patch_id
—
commit_hash
c7cfde26c9669cec341b4856bb6640035236ff66
source_type
github
headline
Guard against infinite loop in vector constant creation
tldr
Added an assertion to prevent an infinite loop in the vectorization pass when creating constant vectors.
author
Christopher Bazley
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • vectorization
  • • optimization
  • • vect
  • • assertion
discussion_id_link
—
bugzilla_pr
—
date
2026-07-30T00:00:00.000Z

The vectorization pass’s vect_create_constant_vectors function could enter an infinite loop under certain conditions where vec_num (the number of vectors to create) becomes zero due to alterations within the function. This change adds an assertion to detect and guard against this scenario, ensuring that the loop terminates and aiding debugging by preventing the outer loop from never entering its inner loop.