Landing: d3779873a231

Project / Subsystem

gcc / gcc

Date

2026-09-19

Author

panciyan

Commit

d3779873a231a723aee979f9a5f24edcd6911091

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
—
commit_hash
d3779873a231a723aee979f9a5f24edcd6911091
source_type
github
headline
Fix alignment of partially-passed stack arguments
tldr
Corrects stack argument alignment for arguments passed partially via registers and stack.
author
panciyan
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • compiler
  • • optimization
  • • risc-v
  • • abi
discussion_id_link
—
bugzilla_pr
—
date
2026-09-19T00:00:00.000Z

This commit fixes an alignment issue in GCC where arguments passed partially through registers and partially on the stack were not correctly aligned. The assign_parm_find_stack_rtl function previously used the full argument boundary for alignment, even when only part of the argument was on the stack. This led to incorrect memory accesses, such as misaligned loads/stores on RISC-V. The fix clamps the alignment to the actual size of the portion on the stack, ensuring correct memory referencing and resolving issues with specific RISC-V instructions.