[Bug fortran/126386] matmul in combination with multiplication and transpose fails to correctly reallocate result array

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 27 20:26:09 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126386

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Thomas Koenig
<tkoenig@gcc.gnu.org>:

https://gcc.gnu.org/g:ebb85adb7bf4391abfad69268ac51d2ef5237071

commit r14-12767-gebb85adb7bf4391abfad69268ac51d2ef5237071
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Sun Jul 26 13:41:32 2026 +0200

    Fix size calculation for reallocation for matmul of rank 2 a and rank 1 b.

    This is a rather simple one-character (well, two-bit) fix for th
    calculation of the size of the reallocation of the LHS if that
    is allocatable.

    gcc/fortran/ChangeLog:

            PR fortran/126386
            * frontend-passes.cc (matmul_lhs_realloc):  Fix size calculation of
            A2B1 case.

    gcc/testsuite/ChangeLog:

            PR fortran/126386
            * gfortran.dg/inline_matmul_28.f90: New test.

    (cherry picked from commit 4d855f3af5b18e539585d1d4832470e500323c12)


More information about the Gcc-bugs mailing list