GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
x86

x86: Use DECL_INCOMING_RTL to check for stack argument passing

Improves x86 argument passing checks by using DECL_INCOMING_RTL for memory operand detection.

This commit refines how GCC determines if arguments are passed on the stack for the x86 architecture. It updates the ix86_argument_passed_on_stack_p function to check the DECL_INCOMING_RTL of an argument. If DECL_INCOMING_RTL points to a memory operand, the argument is now correctly identified as being passed on the stack. This change addresses several PRs related to argument passing on the stack and removes an obsolete function.

In Details

This change modifies the x86 backend's argument passing analysis. DECL_INCOMING_RTL in GCC holds the RTL for the memory location or register where a function argument is received. Previously, ix86_argument_passed_on_stack_p relied on different checks. This commit aligns it to directly inspect DECL_INCOMING_RTL: if it's a memory operand, the argument is on the stack. This directly impacts how stack frame layouts and ABI compliance are handled for arguments in the x86 architecture, addressing issues in PR target/126320, PR target/126450, and PR target/126529.

For Context
DECL_INCOMING_RTL
A GCC internal representation that stores the RTL (Register Transfer Language) describing where a function argument is initially placed (e.g., a specific register or a stack memory location).
RTL
Register Transfer Language, an intermediate representation used within GCC to describe operations on registers and memory.
memory operand
In RTL, an operand that refers to a location in memory, as opposed to a CPU register.
stack frame
A region of memory on the call stack allocated for a function call, used to store local variables, parameters, and return addresses.
ABI
Application Binary Interface. Defines how compiled code interacts at the binary level, including function calling conventions, data types, and system calls.
Filed Under: x86abistack