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

i386: Don't use VCOMX for XFmode compares

Avoids using VCOMX for XFmode compares, fixing a bug for specific floating-point comparisons.

This commit prevents the use of VCOMX for XFmode floating-point compares, addressing a bug reported in PR126676. The change restricts the use of UNSPEC_OPTCOMX to modes where VCOMX is actually available, ensuring correct behavior for these comparisons. A new test case is added to verify the fix.

In Details

This commit modifies the i386 backend's expansion logic for floating-point comparisons. It restricts the use of the UNSPEC_OPTCOMX intrinsic to target modes that support VCOMX, preventing incorrect code generation when VCOMX is not available for XFmode. This addresses an issue where the compiler might incorrectly use VCOMX for comparisons, leading to runtime errors or incorrect results.

For Context
XFmode
A GCC internal mode representing the 80-bit extended-precision floating-point type, often used for intermediate calculations.
VCOMX
A specific floating-point comparison instruction or intrinsic on x86 architectures, likely related to extended precision or specific comparison flags.
UNSPEC_OPTCOMX
A GCC internal representation for a specific, optimized floating-point comparison operation, distinct from standard comparison instructions.
Filed Under: i386floating-pointbugfix