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

zero-scratch-regs-[29|30].c: Disable TARGET_USE_FFREEP to fix testsuite failures

Disables an x87 FPU optimization in i386 test cases to prevent assembler scan failures.

Test cases zero-scratch-regs-29.c and zero-scratch-regs-30.c were failing because the TARGET_USE_FFREEP option, which enables the ffreep instruction as a replacement for fstp, was enabled by default. This led to assembler scan failures as the tests expected fstp. This commit modifies the test cases to disable this optimization using -mtune-ctrl=^use_ffreep, resolving the failures.

In Details

The TARGET_USE_FFREEP machine-dependent option controls the use of the ffreep instruction, which is a variant of fstp that also frees the FPU register. When this option is enabled by default, it can cause testsuite failures if the test expects the older fstp instruction. The fix applies -mtune-ctrl=^use_ffreep to disable this specific optimization for the affected test cases.

For Context
x87 FPU
The floating-point unit integrated into Intel x86 processors, used for floating-point arithmetic.
ffreep
An x87 FPU instruction that stores the top of the FPU stack to memory and frees the register.
fstp
An x87 FPU instruction that stores the top of the FPU stack to memory.
scan-assembler-times
A testsuite utility that checks if the generated assembly code matches specific patterns and counts occurrences.
mtune-ctrl
A GCC option for fine-grained control over processor-specific tuning behaviors, allowing specific optimizations to be enabled or disabled.
Filed Under: i386x87testsuiteoptimization