https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102043
--- Comment #46 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Mikael Morin <mik...@gcc.gnu.org>: https://gcc.gnu.org/g:761dda57482295f9c41fcf87e5defa2ac1959f03 commit r12-8229-g761dda57482295f9c41fcf87e5defa2ac1959f03 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Fri Apr 22 22:52:38 2022 +0200 fortran: Generate an array temporary reference [PR102043] This avoids regressing on char_cast_1.f90 and char_cast_2.f90 later in the patch series when the code generation for array references is changed to use pointer arithmetic. The regressing testcases match part of an array reference in the generated tree dump and itâs not clear how the pattern should be rewritten to match the equivalent with pointer arithmetic. This change uses a method specific to array temporaries to generate array-references, so that these array references are flagged as safe for array indexing and will not be updated to use pointer arithmetic. PR fortran/102043 gcc/fortran/ChangeLog: * trans-array.cc (gfc_conv_expr_descriptor): Use gfc_conv_tmp_array_ref.