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

Xtensa: Fix ICE with double FP constants and -mauto-litpools

Resolves an internal compiler error when using double FP constants with -mauto-litpools.

This commit fixes an internal compiler error (ICE) on the Xtensa architecture that occurred when using double-precision floating-point constants with the -mauto-litpools option. The issue was caused by an incorrect condition in the instruction selection logic, which has been corrected by using satisfies_constraint_Gz instead of CONSTANT_P.

In Details

The xtensa backend's movdf_internal pattern in xtensa.md had a flawed condition using FP_REG_P or CONSTANT_P which incorrectly matched [a, Y] alternatives when -mauto-litpools was enabled, leading to an ICE. This is fixed by replacing CONSTANT_P (operands[1]) with satisfies_constraint_Gz (operands[1]) to correctly select alternatives that do not require splitting.

For Context
ICE
Internal Compiler Error: A condition where the compiler encounters an unrecoverable internal problem and terminates.
-mauto-litpools
A GCC option for the Xtensa architecture that enables automatic placement of floating-point constants into literal pools.
FP_REG_P
A macro that checks if a given RTX (representation tree) represents a floating-point register.
CONSTANT_P
A macro that checks if a given RTX represents a constant value.
satisfies_constraint_Gz
A function that checks if an RTX operand satisfies the Xtensa architecture's 'Gz' constraint, typically for floating-point constants in specific register classes.
RTX
Representation Tree: GCC's internal intermediate representation for expressions and instructions.
Filed Under: xtensacompiler erroroptimization