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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>:

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

commit r15-8079-gb2b139ddee763dd5fd71a3368e5e66399e3c52a3
Author: Harald Anlauf <anl...@gmx.de>
Date:   Sat Mar 15 15:11:22 2025 +0100

    Fortran: fix bogus dependency check in ALLOCATE statement [PR60560]

    Restrict dependency check of ALLOCATE object to variables in the same
    statement, but exclude check of length type parameter that might be
    set in the declaration and could lead to a bogus cyclic dependency.

            PR fortran/60560

    gcc/fortran/ChangeLog:

            * expr.cc (gfc_traverse_expr): Do not descend into length type
            parameter for negative values of auxiliary parameter f.
            * resolve.cc (gfc_find_var_in_expr): New helper function to check
            dependence of an expression on given variable.
            (resolve_allocate_expr): Use it to determine if array bounds in an
            ALLOCATE statement depend explicitly on a variable.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/allocate_error_8.f90: New test.

Reply via email to