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

gccrs: Fix floating-point remainder operation for f32/f64

gccrs now correctly implements the remainder operation for f32 and f64 types by using built-in functions.

gccrs has corrected the implementation of the remainder operation for single-precision (f32) and double-precision (f64) floating-point types. Previously, attempting to use a generic binary operation resulted in an Internal Compiler Error (ICE) because GCC’s later passes do not support this operation for these types. The fix involves calling the appropriate remainder{,f,l} builtins and storing their results.

In Details

In gccrs, the backend for floating-point remainder operations on f32 and f64 was incorrect. It attempted to use a generic fold_build2 binary operation, which is not supported by later GCC compilation passes for these specific types. This commit corrects the implementation by directly invoking the remainder{,f,l} builtins and storing the computed result, resolving a previously uncaught ICE in the testsuite.

For Context
f32
A single-precision floating-point number type, typically 32 bits wide.
f64
A double-precision floating-point number type, typically 64 bits wide.
ICE
Internal Compiler Error. A fatal error occurring within the compiler itself, usually due to an unexpected internal state or bug, halting compilation.
backend
In a compiler, the backend is responsible for generating machine code from an intermediate representation. This involves optimizations specific to the target architecture and the final code generation.
Filed Under: gccrsrustfloating-pointbackend