Landing: 1374c2691343
Project / Subsystem
gcc / dce
Date
2026-08-13
Author
Andrea Pinski
Commit
1374c269134364e5241051c45363e1b0c381f550
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- dce
- patch_id
- —
- commit_hash
- 1374c269134364e5241051c45363e1b0c381f550
- source_type
- github
- headline
- DCE avoids removing call LHS for no_delete case.
- tldr
- DCE will no longer remove the LHS of calls when the 'no_delete' attribute is present, preventing issues with exception handling and function requirements.
- author
- Andrea Pinski
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • dce
- • optimization
- • correctness
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-08-13T00:00:00.000Z
GCC’s Dead Code Elimination (DCE) pass has been modified to prevent the removal of the left-hand side (LHS) of a call instruction when the no_delete attribute is active. This change addresses a problem where removing the LHS and subsequently inserting an assignment could violate basic block invariants, particularly concerning exception handling and functions that require specific statement ordering (e.g., ‘returns twice’ functions). Instead of inserting a new statement, the LHS is now simply not removed, ensuring program correctness.