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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mikael Morin <mik...@gcc.gnu.org>:

https://gcc.gnu.org/g:2e32a12c04c72f692a7bd119fd3e4e5b74392c9d

commit r13-5486-g2e32a12c04c72f692a7bd119fd3e4e5b74392c9d
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Sun Jan 29 21:57:24 2023 +0100

    fortran: Set name for *LOC default BACK argument [PR108450]

    This change fixes an ICE caused by the double resolution of MINLOC,
    MAXLOC and FINDLOC expressions which get a default value for the BACK
    argument at resolution time.  That argument  is added without name,
    and argument reordering code is not prepared to handle unnamed arguments
    coming after named ones, so the second resolution causes a NULL pointer
    dereference.
    The problem is fixed by explicitly setting the argument name.

            PR fortran/108450

    gcc/fortran/ChangeLog:

            * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
            (gfc_check_findloc): Ditto.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/gomp/minmaxloc_1.f90: New test.

Reply via email to