Landing: eae644638908
Project / Subsystem
gcc / tree-optimization
Date
2026-07-14
Author
Naveen
Commit
eae644638908427b11f8d791f718851e25bece01
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- tree-optimization
- patch_id
- —
- commit_hash
- eae644638908427b11f8d791f718851e25bece01
- source_type
- github
- headline
- tree-optimization: Fold length-one memset through arbitrary pointers.
- tldr
- Optimizes length-one memset calls through arbitrary pointers into scalar stores.
- author
- Naveen
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • memset
- • performance
- • bugfix
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-14T00:00:00.000Z
The compiler can now optimize calls to memset with a length of one, even when the destination is an arbitrary pointer (e.g., a function parameter). Previously, such calls were not optimized into scalar stores unless the destination was a known ADDR_EXPR. This change allows folding these into a single byte store, preserving volatile qualification and supporting both constant and non-constant fill values, thereby improving performance and code generation efficiency.