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

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126386

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Thomas Koenig
<[email protected]>:

https://gcc.gnu.org/g:72e30ac4747bcd51c20fc866036ed5e49a2ff5cc

commit r16-9418-g72e30ac4747bcd51c20fc866036ed5e49a2ff5cc
Author: Thomas Koenig <[email protected]>
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)
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.