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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anl...@gcc.gnu.org>:

https://gcc.gnu.org/g:4ee9e57684e27d27ff12e2b93ab7ae3d46861593

commit r11-8852-g4ee9e57684e27d27ff12e2b93ab7ae3d46861593
Author: Harald Anlauf <anl...@gmx.de>
Date:   Wed Jul 28 19:11:27 2021 +0200

    Fortran: ICE in resolve_allocate_deallocate for invalid STAT argument

    gcc/fortran/ChangeLog:

            PR fortran/101564
            * expr.c (gfc_check_vardef_context): Add check for KIND and LEN
            parameter inquiries.
            * match.c (gfc_match): Fix comment for %v code.
            (gfc_match_allocate, gfc_match_deallocate): Replace use of %v code
            by %e in gfc_match to allow for function references as STAT and
            ERRMSG arguments.
            * resolve.c (resolve_allocate_deallocate): Avoid NULL pointer
            dereferences and shortcut for bad STAT and ERRMSG argument to
            (DE)ALLOCATE.  Remove bogus parts of checks for STAT and ERRMSG.

    gcc/testsuite/ChangeLog:

            PR fortran/101564
            * gfortran.dg/allocate_stat_3.f90: New test.
            * gfortran.dg/allocate_stat.f90: Adjust error messages.
            * gfortran.dg/implicit_11.f90: Likewise.
            * gfortran.dg/inquiry_type_ref_3.f90: Likewise.

    (cherry picked from commit 7bf582e6cfcef922a087b1b2b42aa04ea9cb2d94)

Reply via email to