Landing: cf6605e1e4a1

Project / Subsystem

gcc / gcc/lra

Date

2026-09-11

Author

Vladimir N. Makarov

Commit

cf6605e1e4a1ab76a09f96635b919e53aaf48af1

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/lra
patch_id
—
commit_hash
cf6605e1e4a1ab76a09f96635b919e53aaf48af1
source_type
github
headline
Inherit optional reload for output operands
tldr
Fixes incorrect code generation by ensuring optional reloads for output operands are properly inherited.
author
Vladimir N. Makarov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • register allocation
  • • optimization
  • • compiler bug
discussion_id_link
github:gcc-mirror/gcc#127244
bugzilla_pr
—
date
2026-09-11T00:00:00.000Z

This commit corrects a bug in the late-stage register allocator (LRA) where optional reloads for output operands were not being inherited. This oversight resulted in suboptimal or incorrect code generation for certain operations. The patch introduces a new function, inheritance_pseudo_p, and modifies undo_optional_reloads to ensure that optional reloads for output operands are preserved if they are inherited, thereby fixing the reported issue and improving code quality.