http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50409

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code, patch
             Status|NEW                         |ASSIGNED
                 CC|                            |fxcoudert at gcc dot
                   |                            |gnu.org

--- Comment #3 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> 
2011-11-08 22:31:36 UTC ---
This is actually the same bug as PR48876, but the original fix was not enough.
The following fixes it for good (fingers crosser, obviously!):

Index: expr.c
===================================================================
--- expr.c    (revision 181149)
+++ expr.c    (working copy)
@@ -1853,8 +1853,8 @@ gfc_simplify_expr (gfc_expr *p, int type
       if (p->ref && p->ref->u.ss.end)
         gfc_extract_int (p->ref->u.ss.end, &end);

-      if (end < 0)
-        end = 0;
+      if (end < start)
+        end = start;

       s = gfc_get_wide_string (end - start + 2);
       memcpy (s, p->value.character.string + start,

Reply via email to