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

i386: Don't split V2DF load when the adjusted address is invalid

Prevents an ICE in the i386 backend when splitting V2DF loads results in an invalid memory address.

This commit prevents an internal compiler error (ICE) in the i386 backend when attempting to split a V2DF load instruction. The split operation requires adjusting the memory address by 8 bytes. If the original address displacement is already at its maximum encodable value, adding 8 results in an address that cannot be represented by the x86’s 32-bit signed displacement field. The change skips this split in such cases, ensuring the address remains valid.

In Details

The ix86_split_stlf_stall_load function splits a V2DF load (e.g., movlpd + movhpd) by requiring the load address to be offset by 8. This optimization fails when the original memory address displacement (a 32-bit signed value) is near its maximum limit (e.g., 0x7ffffff8). Adding 8 to this displacement results in 0x80000000, which is out of range for the signed 32-bit displacement field used in x86 addressing modes. The adjust_address function then encounters an ICE. This patch adds a check to skip the split if the adjusted address would be invalid.

For Context
V2DF
A data type representing two double floating-point values, typically stored in a 128-bit SSE register.
ICE
Internal Compiler Error, an unrecoverable error within the compiler itself, usually indicating a bug.
displacement
An offset added to a base register or address to form the final memory address. In x86, displacements have specific size and signedness constraints.
PARM_DECL
Parameter declaration, referring to a function argument passed on the stack or in registers.
Filed Under: i386backendICEload