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

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

https://gcc.gnu.org/g:1b8929ea849f7340908829bf73b4472aa0c6cbf6

commit r15-11184-g1b8929ea849f7340908829bf73b4472aa0c6cbf6
Author: Thomas Koenig <[email protected]>
Date:   Tue May 19 14:09:35 2026 +0200

    PR fortran/115260 - fix data corruption on inline packing/unpacking

    This patch fixes a data corruption occuring when a non-contiguous slice of
an
    allocatable array component was passed to a procedure expecting a g77-style
    argument.  The problem was the inline packing (PR fortran/88821) which went
    astray gfc_trans_scalar_assign was told to deallocate the argument upon
    return.

    The solution was to not pass that argument if passing a g77-style array,
    in effect a one-liner.

    This is a regression which goes back to all supported releases.

    gcc/fortran/ChangeLog:

            PR fortran/115260
            * trans-expr.cc (gfc_conv_subref_array_arg): Pass false to
            dealloc argument of gfc_trans_scalar_assign if we are
            converting a g77-style argument.

    gcc/testsuite/ChangeLog:

            PR fortran/115260
            * gfortran.dg/pr115260.f90: New test.

Reply via email to