Landing: c62176c0ea0d
Project / Subsystem
gcc / gcc/aarch64
Date
2026-07-30
Author
Kyrylo Tkachov
Commit
c62176c0ea0d8139161ebb82fabfa0a02e493e2e
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc/aarch64
- patch_id
- —
- commit_hash
- c62176c0ea0d8139161ebb82fabfa0a02e493e2e
- source_type
- github
- headline
- Fixes incorrect code generation for aarch64 max/min-of-add/sub.
- tldr
- Ensures correct condition code handling for aarch64 conditional selects.
- author
- Kyrylo Tkachov
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • aarch64
- • code generation
- • compiler bug
- • optimization
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-30T00:00:00.000Z
A bug in aarch64 code generation for max/min-of-add/sub patterns caused incorrect results by not properly indicating that these instructions clobber condition codes. This led to the compiler removing necessary comparison instructions, resulting in a conditional select (csel) using stale flags. The fix adds a (clobber (reg:CC CC_REGNUM)) to the relevant instruction patterns, ensuring that condition codes are correctly marked as modified. This preserves the necessary comparison instructions and resolves the miscompilation.