SUNDAY, APRIL 19, 2026 GCC DIGEST · OPEN-SOURCE SYSTEMS DAILY VOL. 1 · NO. 109
Late Edition · APRIL 19, 2026 · VOL. 1 · NO. 109
The GCC Digest
— A Daily Record of the GNU Compiler Collection —
fortran Impact 5 / 10

Fortran: Fix wrong result for SPREAD with ncopies < 0.

The `SPREAD` intrinsic in Fortran now correctly handles negative `ncopies` arguments, which produce a zero-sized array.

The SPREAD intrinsic in Fortran was producing incorrect results when the ncopies argument was negative. The fix modifies the spread.m4 macro to handle the scalar source case with ncopies < 0, which should result in a zero-sized array. The generated code for various data types has been regenerated, and a new test case has been added.

Filed Under: fortranintrinsicarraybugfix