Landing: 54dd6575fa5b

Project / Subsystem

gcc / gcc/tree-optimization

Date

2026-07-07

Author

Naveen

Commit

54dd6575fa5ba7554396039820bee88d4dddab6d

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/tree-optimization
patch_id
commit_hash
54dd6575fa5ba7554396039820bee88d4dddab6d
source_type
github
headline
Improve CDCE memset optimization for {0, N} ranges
tldr
GCC's CDCE optimization now better handles memset calls with {0, N} length ranges.
author
Naveen
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • gcc
  • memset
discussion_id_link
bugzilla_pr
date
2026-07-07T00:00:00.000Z

This patch enhances the CDCE (Conditional Dead Code Elimination) optimization to better support memset calls where the length is known to be exactly 0 or another constant N. Previously, this optimization only handled lengths in ranges [0, 1]. The update allows the pass to specialize the memset call to a constant length N, improving code generation for these specific cases. New test cases are added to verify the fix.