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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c    (revision 1050250)
+++ gcc/fortran/trans-expr.c    (working copy)
@@ -2374,7 +2374,8 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int ki
   if (!CONSTANT_CLASS_P (tmp) && !DECL_P (tmp))
     end.expr = gfc_evaluate_now (end.expr, &se->pre);

-  if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
+  if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
+      && !ref->u.ss.start->symtree->n.sym->attr.implied_index)
     {
       tree nonempty = fold_build2_loc (input_location, LE_EXPR,
                                       logical_type_node, start.expr,

Reply via email to