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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jerry DeLisle <[email protected]>:

https://gcc.gnu.org/g:35dec12b401e1e99df7219542db057e59dbefd02

commit r17-3936-g35dec12b401e1e99df7219542db057e59dbefd02
Author: Jerry DeLisle <[email protected]>
Date:   Mon Aug 10 16:18:42 2026 -0700

    fortran: [PR126777] Fix ICE for IMAGE_INDEX with a TEAM argument

    trans_image_index translated the scalar TEAM/TEAM_NUMBER argument with
    gfc_conv_expr_descriptor, which routes rank-0 expressions to
    walk_coarray and asserts there.  Use gfc_conv_expr_val, as
    trans_num_images and trans_this_image already do.

    PR fortran/126777

    Assisted-by: Claude Opus 5

    gcc/fortran/ChangeLog:

            PR fortran/126777
            * trans-intrinsic.cc (trans_image_index): Translate the team
            argument with gfc_conv_expr_val.
            (trans_num_images): Force the team_number lvalue into the
            argument block, not the enclosing one.

    gcc/testsuite/ChangeLog:

            PR fortran/126777
            * gfortran.dg/coarray/image_index_team_1.f90: New test.

Reply via email to