Landing: a33b41d895f5
Project / Subsystem
gcc / c++
Date
2026-05-28
Author
Marek Polacek
Commit
a33b41d895f55fd95f8c9f486f6ef23c71a7a1e5
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- a33b41d895f55fd95f8c9f486f6ef23c71a7a1e5
- source_type
- github
- headline
- c++: Fix infinite looping with arr[arr] [PR125454]
- tldr
- Fixes an infinite recursion in C++ code when an array is indexed by itself, like arr[arr].
- author
- Marek Polacek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • bugfix
- • compiler
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-05-28T00:00:00.000Z
A recent change in GCC’s C++ front-end caused an infinite recursion when handling array indexing expressions of the form array[array]. The compiler would repeatedly swap the array and index, leading to a stack overflow. This commit prevents the canonicalization step from recursing when the array is indexed by itself.