Landing: b6477e6c4efd

Project / Subsystem

gcc / debug

Date

2026-07-22

Author

Longjun Luo

Commit

b6477e6c4efd6df2719190cb048cf300ff31af46

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
debug
patch_id
—
commit_hash
b6477e6c4efd6df2719190cb048cf300ff31af46
source_type
github
headline
Preserve debug info for IPA ICF wrappers
tldr
Ensures debug information is correctly attached to function wrappers created by IPA ICF.
author
Longjun Luo
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • debug info
  • • IPA
  • • ICF
  • • debugging
discussion_id_link
—
bugzilla_pr
—
date
2026-07-22T00:00:00.000Z

This commit resolves an issue where debug information was not correctly attached to function wrappers generated by IPA ICF (Interprocedural Analysis, Identical Code Folding). When ICF replaces a function’s body with a wrapper, the original function’s debug info could be lost. The fix preserves the DECL_IGNORED_P flag across forced GIMPLE thunk expansion, allowing the wrapper’s address to be correctly associated with its corresponding debug subprogram DIE. A new test case verifies this fix.