gnu/gcc/35dec12b401e1e99df7219542db057e59dbefd02 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.
2 files changed