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

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

https://gcc.gnu.org/g:82ca86233da61e868a91b6132191148230d56ab0

commit r12-9266-g82ca86233da61e868a91b6132191148230d56ab0
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.cc (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