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

--- Comment #8 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:f68f0e69d988ca999c09953811f3cc722f114677

commit r11-10584-gf68f0e69d988ca999c09953811f3cc722f114677
Author: Harald Anlauf <anl...@gmx.de>
Date:   Sat Mar 11 15:37:37 2023 +0100

    Fortran: fix bounds check for copying of class expressions [PR106945]

    In the bounds check for copying of class expressions, the number of
elements
    determined from a descriptor, returned as type gfc_array_index_type (i.e. a
    signed type), should be converted to the type of the passed element count,
    which is of type size_type_node (i.e. unsigned), for use in comparisons.

    gcc/fortran/ChangeLog:

            PR fortran/106945
            * trans-expr.c (gfc_copy_class_to_class): Convert element counts in
            bounds check to common type for comparison.

    gcc/testsuite/ChangeLog:

            PR fortran/106945
            * gfortran.dg/pr106945.f90: New test.

    (cherry picked from commit 2cf5f485e0351bb1faf46196a99e524688f3966e)

Reply via email to