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

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

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

commit r17-600-gd81f2cb42b418484050599906f41978ed5005eaa
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