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

i386: Use psABI note for unions with long double

i386: Adjusts how unions with long double are handled for psABI compliance, affecting specific type classifications.

This change modifies the i386 backend to correctly use the psABI note infrastructure for unions containing long double. Previously, the classification logic could be inconsistent for certain type combinations, leading to incorrect ABI behavior. The update ensures that the compiler correctly identifies and signals changes related to these unions, aligning with GCC 4.4 and later calling conventions. A new test case is added to verify this fix.

In Details

The i386 backend's classify_argument function now uses psabi_new_behavior_p to distinguish between pre-GCC 4.4 and post-GCC 4.4 behavior for unions with long double. This addresses an issue where X86_64_X87UP_CLASS was incorrectly flagged when X86_64_X87_CLASS was not present. The change refactors the class handling to correctly map to X86_64_SSE_CLASS for older behavior, ensuring accurate ABI compliance for these types.

For Context
psABI
The processor-specific Application Binary Interface. It defines how software components interact at the binary level, including function calling conventions, data type representations, and system call interfaces.
union
A user-defined data type in C and C++ that can store different data types in the same memory location. Only one member of the union can be in use at any given time.
long double
A floating-point data type that provides higher precision than standard double-precision floating-point types. Its exact size and representation are platform-dependent.
i386
The original 32-bit Intel x86 architecture. This designation is often used to refer to GCC's backend targeting this architecture and its compatible variants.
X86_64_X87UP_CLASS
A classification used in GCC's i386 backend to identify a specific floating-point data type or state related to the x87 FPU, potentially involving extended precision.
X86_64_SSE_CLASS
A classification used in GCC's i386 backend to identify floating-point data types handled by the SSE (Streaming SIMD Extensions) instruction set, which uses a different calling convention than the x87 FPU.
Filed Under: i386abilong doubleunions