GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
fortran

Fix ICE with loops using non-integral iterators [PR126303]

Fixes an internal compiler error in Fortran loops with deprecated non-integral iterators.

A Fortran internal compiler error (ICE) caused by loops with non-integral iterators has been fixed. The issue arose from accessing iterator data structures incorrectly when they were not of an integral type, leading to garbage data or crashes. The fix ensures these loops are now punted upon.

In Details

Resolves an ICE in the Fortran front-end by ensuring inner_loop_may_be_skipped returns true when the inner loop's iterator is not integral. This prevents incorrect access to GMP's mpz_t or mpfr_t structures when they are used for non-integral loop iterators, avoiding crashes and garbage results.

For Context
ICE
Internal Compiler Error. A severe error where the compiler encounters an unexpected condition and cannot continue processing, often due to a bug within the compiler itself.
iterator
In programming, an object that enables a programmer to traverse a container (like a list or array) and access its elements. In Fortran's DO loops, it represents the loop control variable.
GMP
The GNU Multiple Precision Arithmetic Library. It is used by GCC for arbitrary-precision arithmetic, particularly for handling very large integers or fractions, which can arise in Fortran's numeric operations.
Filed Under: fortrancompilerbugfixperformance