GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
x86

Check callee-spilled register arguments on x86.

x86 calling convention now correctly accounts for register arguments spilled by the callee.

The x86 calling convention logic has been updated to correctly handle register arguments that are spilled by the callee. Previously, the ix86_argument_passed_on_stack_p function ignored such spills, assuming the caller was responsible for stack alignment. A new function, ix86_spill_register_argument_p, is introduced to check for these callee-spills, improving stack argument handling accuracy and fixing PR target/126320.

In Details

This commit updates the x86 ABI handling for stack arguments, specifically addressing cases where a callee spills a register argument to the stack. The ix86_argument_passed_on_stack_p function now calls a new helper ix86_spill_register_argument_p to detect and account for these spills. This is crucial for correct stack frame management and argument passing when register pressure forces spills.

For Context
x86
A family of instruction set architectures developed by Intel, widely used in desktop and server computers.
calling convention
A set of rules for how functions pass arguments and return values. This includes stack layout, register usage, and argument passing order.
callee
The function that is called by another function.
spill
The process of saving a value from a register to memory (usually the stack) because the register is needed for another value.
ABI
Application Binary Interface. Defines how compiled code interacts at the machine-code level, including calling conventions, data format, and system call interfaces.
Filed Under: x86abicalling convention