[Bug fortran/106546] Incorrect reuse of allocatable array temporaries under -O2 -fno-automatic
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 21 22:10:01 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106546
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Thomas Koenig
<tkoenig@gcc.gnu.org>:
https://gcc.gnu.org/g:9919b2a44ec4a3f6042569637ee6fd784d427fa4
commit r13-10335-g9919b2a44ec4a3f6042569637ee6fd784d427fa4
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date: Wed May 20 22:43:10 2026 +0200
PR fortran/106546 - inline matmul with -fno-automatic
There was a problem caused with allocatable arrays used for
front-end optimization when -fno-automatic was specified.
Solved by explicitly setting the automatic attribute on the
symbol. It required "-O2 -fcheck=bounds -fno-automatic"
to be seen.
gcc/fortran/ChangeLog:
PR fortran/106546
* frontend-passes.cc (create_var): Set attr->automatic on
new symbol.
(create_do_loop): Likewise on iteration variable.
gcc/testsuite/ChangeLog:
PR fortran/106546
* gfortran.dg/inline_matmul_27.f90: New test.
(cherry picked from commit 996673496e9cbc05b6ec55f0ab1324c3ffe4a876)
More information about the Gcc-bugs
mailing list