[Bug fortran/83874] [6/7/8 Regression] ICE initializing character array from derived type
anlauf at gmx dot de
gcc-bugzilla@gcc.gnu.org
Wed Jan 17 20:14:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83874
--- Comment #4 from Harald Anlauf <anlauf at gmx dot de> ---
The following obvious patch fixes the ICE:
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 256671)
+++ gcc/fortran/decl.c (working copy)
@@ -1718,7 +1718,7 @@
}
else if (init->expr_type == EXPR_ARRAY)
{
- if (init->ts.u.cl)
+ if (init->ts.u.cl && init->ts.u.cl->length)
{
const gfc_expr *length = init->ts.u.cl->length;
if (length->expr_type != EXPR_CONSTANT)
Needs regtesting, though.
More information about the Gcc-bugs
mailing list