Landing: 4765a2e39807
Project / Subsystem
gcc / tree-optimization
Date
2026-04-27
Author
Netanel Komm
Commit
4765a2e3980749c9eebd313b53d5be5aecf855be
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- tree-optimization
- patch_id
- —
- commit_hash
- 4765a2e3980749c9eebd313b53d5be5aecf855be
- source_type
- github
- headline
- Tree-optimization Lowers mempcpy to memcpy When Result is Unused.
- tldr
- The compiler now optimizes `mempcpy` calls to `memcpy` when the return value is ignored, potentially improving performance.
- author
- Netanel Komm
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • tree-optimization
- • memcpy
- • mempcpy
- • gimple
- • performance
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-04-27T00:00:00.000Z
The GIMPLE folding pass now transforms __builtin_mempcpy into __builtin_memcpy when the return value of mempcpy is unused. Since many targets have highly optimized memcpy implementations, this transformation can improve code generation. New tests were added to ensure both the unfolded and folded mempcpy are properly handled.