[Bug fortran/83864] ICE in gfc_apply_init, at fortran/expr.c:4271

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Tue Jan 16 22:06:00 GMT 2018


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

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gmx dot de

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
The trivial check on valid length

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (revision 256671)
+++ gcc/fortran/expr.c  (working copy)
@@ -4267,7 +4269,7 @@
         gfc_set_constant_character_len (len, init, -1);
       else if (init
               && init->ts.type == BT_CHARACTER
-               && init->ts.u.cl
+               && init->ts.u.cl && init->ts.u.cl->length
                && mpz_cmp (ts->u.cl->length->value.integer,
                            init->ts.u.cl->length->value.integer))
         {

makes the code in comment #0 compile.

Haven't tried whether it works properly.


More information about the Gcc-bugs mailing list