Landing: 2db2cf62f1ad

Project / Subsystem

gcc / risc-v

Date

2026-07-15

Author

Jin Ma

Commit

2db2cf62f1ad2788365b1898aefdba2fa76aab87

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
risc-v
patch_id
—
commit_hash
2db2cf62f1ad2788365b1898aefdba2fa76aab87
source_type
github
headline
RISC-V: Avoid frame-pointer references in epilogue stack ties
tldr
Prevents incorrect frame pointer usage in RISC-V epilogues, avoiding register corruption during unwinding.
author
Jin Ma
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • risc-v
  • • debugging
  • • unwinding
discussion_id_link
—
bugzilla_pr
—
date
2026-07-15T00:00:00.000Z

This commit addresses an issue in the RISC-V backend where epilogue stack ties incorrectly referenced the frame pointer (s0) when no frame pointer was used. This made the register appear live, potentially leading to regrename corrupting callee-saved state during exception unwinding. The fix introduces a new SP-only pattern for epilogue barriers, ensuring stack ties correctly reference only the stack pointer when a frame pointer is absent, thus preserving unwinding integrity.