Landing: 1d6d7e982a98
Project / Subsystem
gcc / mips
Date
2026-06-07
Author
Xi Ruoyao
Commit
1d6d7e982a982724ed8d9efc7eaa0f38638f8027
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- mips
- patch_id
- —
- commit_hash
- 1d6d7e982a982724ed8d9efc7eaa0f38638f8027
- source_type
- github
- headline
- MIPS fixes uninitialized operand use in sync operations
- tldr
- This patch corrects uninitialized operand use in MIPS RTL templates for atomic synchronization operations, preventing incorrect code generation.
- author
- Xi Ruoyao
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • mips
- • bugfix
- • atomic-operations
- • rtl
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-07T00:00:00.000Z
The MIPS backend for GCC had a subtle bug in its atomic synchronization RTL templates (sync_old_<optab>_12 and sync_new_<optab>_12). When an instruction’s RTL template had multiple elements, leading to a parallel expression, an operand (register 1, the output) was being used before its value was officially set. This could lead to incorrect code generation, sometimes resulting in unexpected arithmetic. The patch reorders the operand usage to ensure values are set before being read.