[Patch, fortran] PR120431 - SPREAD does not handle scalar argument and NCOPIES=-1 correctly

Paul Richard Thomas <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <CAGkQGiKzs-E581yBE9tSPyA3jYAv3Oth8Q0XTvJxp4MrLB8AWA@mail.gmail.com>
Hello All,

Pushed to mainline as 'obvious' and closed.

Paul

Fortran: Fix wrong result for SPREAD with ncopies < 0 [PR120431]

2026-04-17  Steven G. Kargl  <[email protected]>

PR libfortran/120431
* m4/spread.m4: Fix scalar source case with ncopies < 0.
* generated/spread_c10.c: Regenerated.
* generated/spread_c16.c: Ditto.
* generated/spread_c17.c: Ditto.
* generated/spread_c4.c: Ditto.
* generated/spread_c8.c: Ditto.
* generated/spread_i1.c: Ditto.
* generated/spread_i16.c: Ditto.
* generated/spread_i2.c: Ditto.
* generated/spread_i4.c: Ditto.
* generated/spread_i8.c: Ditto.
* generated/spread_r10.c: Ditto.
* generated/spread_r16.c: Ditto.
* generated/spread_r17.c: Ditto.
* generated/spread_r4.c: Ditto.
* generated/spread_r8.c: Ditto.

2026-04-17  Steven G. Kargl  <[email protected]>

gcc/testsuite
PR fortran/120431
* gfortran.dg/spread_scalar_zerosize.f90: New testcase.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.