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

Enable IEEE floating-point behavior in UBSan float tests.

Adds `dg-add-options ieee` to UBSan float tests on Alpha to prevent premature test termination due to SIGFPE.

This commit modifies several UBSan (Undefined Behavior Sanitizer) tests for floating-point operations by adding the dg-add-options ieee directive. On the Alpha architecture, without this option, floating-point exceptions like division by zero or invalid conversions trigger a SIGFPE signal, causing the tests to terminate prematurely. Enabling IEEE compliance ensures these tests run to completion and correctly report any detected undefined behavior.

In Details

The c-c++-common/ubsan/float-*.c tests are failing on Alpha due to the absence of the -mieee (or equivalent) compiler option. Without this option, Alpha's FPU raises SIGFPE on operations such as division by zero or conversions of NaN/infinity. This signal terminates the test process before the UBSan output can be fully captured and verified. Adding dg-add-options ieee ensures that the tests are compiled with the necessary flags to handle these situations gracefully, allowing UBSan to report the intended undefined behavior.

For Context
UBSan
Undefined Behavior Sanitizer. A runtime tool in GCC and Clang that detects various types of undefined behavior during program execution, such as signed integer overflow, invalid floating-point operations, and use-after-free.
SIGFPE
A signal raised by the operating system to a process when it performs an erroneous arithmetic operation, such as division by zero or an invalid floating-point operation.
Alpha
A RISC instruction set architecture developed by Digital Equipment Corporation (DEC). GCC has support for targeting Alpha processors.
dg-add-options
A GCC testsuite directive used to add specific compiler options to the compilation of a test case.
IEEE floating-point
Refers to the IEEE 754 standard for floating-point arithmetic, which defines behavior for operations like division by zero, NaN (Not a Number), and infinity, often through exceptions or special values rather than immediate program termination.
Filed Under: gcctestsuiteubsanalphafloating-point