Landing: a82d2c6816ff
Project / Subsystem
gcc / ext-dce
Date
2026-03-06
Author
Philipp Tomsich
Commit
a82d2c6816ff9f3afce67a6cb3cd5d8fe0f9af5d
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- ext-dce
- patch_id
- —
- commit_hash
- a82d2c6816ff9f3afce67a6cb3cd5d8fe0f9af5d
- source_type
- github
- headline
- Only remove REG_EQUAL/EQUIV notes on successful optimization
- tldr
- Fixes a bug in the extended dead code elimination pass where REG_EQUAL/EQUIV notes were removed even when the optimization failed.
- author
- Philipp Tomsich
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • optimization
- • bugfix
- • dead code elimination
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-03-06T00:00:00.000Z
This commit fixes a bug in the extended dead code elimination (ext-dce) pass. Previously, REG_EQUAL and REG_EQUIV notes were unconditionally removed after attempting an optimization, even if the optimization failed during validation. This could lead to incorrect code generation in subsequent passes because the REG_EQUAL hint was lost on an unchanged instruction. Now, the note removal is guarded by a flag that ensures notes are only removed when the transformation is successfully committed.