Landing: 517d45af94f9

Project / Subsystem

gcc / avoid-store-forwarding

Date

2026-03-31

Author

Konstantinos Eleftheriou

Commit

517d45af94f98f2c8c8bdf5231aa662c82b46c13

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
avoid-store-forwarding
patch_id
commit_hash
517d45af94f98f2c8c8bdf5231aa662c82b46c13
source_type
github
headline
Reapply extension after bit insert in store-forwarding
tldr
GCC's avoid-store-forwarding pass now correctly reapplies sign/zero extensions to values after bit-field insertions for non-eliminated loads.
author
Konstantinos Eleftheriou
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • rtl
  • aarch64
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-03-31T00:00:00.000Z

This commit fixes a bug in the avoid-store-forwarding pass where SIGN_EXTEND or ZERO_EXTEND semantics were lost after a bit insert sequence. When an extending load was not fully eliminated, the bit-field insert operated on the full-width register but failed to reapply the extension, leading to stale upper bits. The fix ensures that the correct extension is re-applied, mirroring the behavior of fully eliminated loads, preventing incorrect values from propagating.