Landing: 2791799fe11f

Project / Subsystem

gcc / gcc/optimization

Date

2026-08-06

Author

Kyrylo Tkachov

Commit

2791799fe11f886736869e3aff093e0c14fb10b8

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/optimization
patch_id
—
commit_hash
2791799fe11f886736869e3aff093e0c14fb10b8
source_type
github
headline
pair-fusion: Verify that a fused pair really is adjacent
tldr
Fixes pair-fusion optimization to prevent incorrect code generation by ensuring fused memory accesses are truly adjacent.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • correctness
  • • code generation
  • • gcc
discussion_id_link
—
bugzilla_pr
—
date
2026-08-06T00:00:00.000Z

The pair-fusion optimization pass has been corrected to accurately verify that fused memory accesses are indeed adjacent. Previously, when using MEM_EXPR base offsets, the pass could incorrectly identify non-adjacent memory accesses as adjacent, leading to silent generation of wrong code. This fix adds a check to compare offsets relative to a common base register, preventing such misinterpretations and ensuring correctness.