Landing: 5d3f80d7d9ba

Project / Subsystem

gcc / tree-optimization

Date

2026-09-02

Author

Richard Biener

Commit

5d3f80d7d9baf9207bb037a85ad78f3bcee4e41b

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
5d3f80d7d9baf9207bb037a85ad78f3bcee4e41b
source_type
github
headline
tree-optimization: Preserve reverse storage order during reference translation
tldr
tree-optimization: Fixes incorrect bit numbering by punting reference translation through aggregate copies when storage order is reversed.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • endianness
  • • tree
discussion_id_link
—
bugzilla_pr
—
date
2026-09-02T00:00:00.000Z

This commit enhances the vn_reference_lookup_3 function in the tree-optimization pass to correctly handle references within aggregate copies that have a reversed storage order. Previously, if the lookup reduced to a base plus offset and consumed all original operands, the reverse storage order information was lost. This led to incorrect interpretation of stored bytes with wrong bit numbering on assignment. The fix makes the function punt in such cases, preserving the correct storage order and preventing value misinterpretation.