[Bug fortran/85083] [8 Regression] ICE in gfc_convert_to_structure_constructor, at fortran/primary.c:2915

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Mon Mar 26 20:40:00 GMT 2018


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

Harald Anlauf <anlauf at gmx dot de> changed:

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

--- Comment #1 from Harald Anlauf <anlauf at gmx dot de> ---
The ICE is fixed by the obvious check:

Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c       (revision 258846)
+++ gcc/fortran/primary.c       (working copy)
@@ -2898,6 +2898,7 @@
       if (this_comp->ts.type == BT_CHARACTER && !this_comp->attr.allocatable
          && this_comp->ts.u.cl && this_comp->ts.u.cl->length
          && this_comp->ts.u.cl->length->expr_type == EXPR_CONSTANT
+         && actual->expr->ts.type == BT_CHARACTER
          && actual->expr->expr_type == EXPR_CONSTANT)
        {
          ptrdiff_t c, e;


This restores the original error message.


More information about the Gcc-bugs mailing list