Landing: 6a3f305b2984
Project / Subsystem
gcc / lto
Date
2026-05-11
Author
Michal Jires
Commit
6a3f305b298438091ef45f92553618d92a47f8dd
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- lto
- patch_id
- —
- commit_hash
- 6a3f305b298438091ef45f92553618d92a47f8dd
- source_type
- github
- headline
- LTO: Fix cache partitioning to handle zero min partition size
- tldr
- Prevents division-by-zero errors in LTO cache partitioning when minimum partition size is zero.
- author
- Michal Jires
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • lto
- • compiler
- • optimization
- • bugfix
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-05-11T00:00:00.000Z
The Link-Time Optimization (LTO) cache partitioning feature in GCC previously asserted that both minimum and maximum partition sizes must be non-zero. This commit relaxes that restriction by handling a min_partition_size of 0. Instead of asserting, it clamps the value to 1, preventing potential division-by-zero errors and allowing for reasonable default behavior in such cases. A new test case is added to verify this fix.