Landing: 80ade12f5384
Project / Subsystem
gcc / gcc/frange
Date
2026-07-29
Author
Aldy Hernandez
Commit
80ade12f5384a27fbed0717fcee9c39427f9f989
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/frange
- patch_id
- —
- commit_hash
- 80ade12f5384a27fbed0717fcee9c39427f9f989
- source_type
- github
- headline
- Store sub-ranges in a variable-length trailing array.
- tldr
- Value range storage now uses variable-length arrays for sub-ranges, optimizing memory use from O(MAX_PAIRS) to O(actual_pairs).
- author
- Aldy Hernandez
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • memory
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-29T00:00:00.000Z
The frange_storage mechanism has been optimized for memory efficiency. Previously, it allocated space for the maximum possible number of sub-ranges (MAX_PAIRS), even if only one was used. This change revises frange_storage to use a variable-length trailing array, similar to irange_storage, so that memory is allocated only for the actual number of sub-ranges needed. This reduces memory overhead for the majority of cached ranges.