Landing: 39e7936c2ba2

Project / Subsystem

gcc / x86

Date

2026-09-28

Author

Richard Biener

Commit

39e7936c2ba2dea099bca58d12d9d0721d4eae55

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
x86
patch_id
—
commit_hash
39e7936c2ba2dea099bca58d12d9d0721d4eae55
source_type
github
headline
Fix load combining peepholes for adjacent stack loads
tldr
Corrected x86 load combining to prevent reordering of loads around stores.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • x86
  • • optimization
  • • peephole
  • • compiler
discussion_id_link
—
bugzilla_pr
—
date
2026-09-28T00:00:00.000Z

This commit fixes an issue in x86 load combining peepholes that could lead to incorrect instruction scheduling. When combining two adjacent stack loads into a wider V2DFmode load using adjust_address, the MEM_EXPR and MEM_ALIAS_SET were not properly updated. This allowed later scheduling passes to move the widened load before a preceding store, causing incorrect program behavior. The fix replaces adjust_address with widen_memory_access, which correctly updates MEM_EXPR and resets MEM_ALIAS_SET, while also adjusting operand checking to avoid merging loads from different parameters.