GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
sparc

SPARC: Fix internal error in function argument handling

SPARC backend now correctly handles structures/unions passed as function arguments, fixing an assertion failure.

This commit resolves an assertion failure in the SPARC backend’s function_arg_record_value routine. The issue stemmed from incorrect argument slot calculation for structures containing a single float element when passed as the seventh argument. The fix redirects these cases to the BLKmode path, ensuring correct stack-based passing on Linux and adding a new test case.

In Details

An assertion failure in function_arg_record_value on SPARC was traced to function_arg_slotno returning an incorrect slot for structures containing a 1-element float array passed as the 7th argument on Linux. This commit modifies function_arg_slotno to unconditionally use the BLKmode path for all structures and unions, resolving the issue and adding a new test case.

For Context
BLKmode
BLKmode is a GCC internal representation mode used for blocks of memory, typically for structures, unions, and arrays. Using BLKmode ensures that these aggregate types are handled as single units during operations like passing them as function arguments or returning them.
SPARC
SPARC (Scalable Processor Architecture) is a RISC instruction set architecture. GCC has specific backends for various SPARC processors.
Filed Under: sparcbugfix