Landing: d794365c8f0d

Project / Subsystem

gcc / ipa

Date

2026-09-05

Author

Rohith Kapelli

Commit

d794365c8f0dcf6c5cdd742296c64c19278de1f8

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
ipa
patch_id
—
commit_hash
d794365c8f0dcf6c5cdd742296c64c19278de1f8
source_type
github
headline
ipa-icf: Compare fields, not just offsets, for ADDR_EXPR under OEP_ADDRESS_OF
tldr
Fixes interprocedural constant propagation to correctly identify identical fields in structs, preventing incorrect code unification.
author
Rohith Kapelli
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • ipa
  • • bugfix
discussion_id_link
—
bugzilla_pr
—
date
2026-09-05T00:00:00.000Z

The interprocedural constant propagation (IPA-ICF) pass incorrectly unified structs with different field declarations but identical offsets. This occurred when comparing ADDR_EXPRs under OEP_ADDRESS_OF, where it accepted different FIELD_DECLs with the same offset. A new flag, OEP_ADDRESS_OF_SAME_FIELD, is introduced to ensure that only identical fields are considered equivalent, thus preventing errors like the one in PR119006 where a strlen calculation failed after struct unification.