diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2016-12-10 18:35:47 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2016-12-10 18:35:47 +0000 |
commit | c3879be19f1277f6641b6224b968b3d1d6453313 (patch) | |
tree | 10004e588a1942421170bde3fb035b34ef37cd0e /gcc/fortran/resolve.c | |
parent | c0140e3c5d3f3b8090e8c21ad530a8986525eb76 (diff) | |
download | gcc-c3879be19f1277f6641b6224b968b3d1d6453313.zip gcc-c3879be19f1277f6641b6224b968b3d1d6453313.tar.gz gcc-c3879be19f1277f6641b6224b968b3d1d6453313.tar.bz2 |
re PR fortran/78350 (ICE in gfc_code2string(): Bad code, at fortran/misc.c:193)
2016-12-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78350
* resolve.c (resolve_structure_cons): Remove the block that
tried to remove a charlen and rely on namespace cleanup.
From-SVN: r243517
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index d04b431..c7d872c 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1257,31 +1257,12 @@ resolve_structure_cons (gfc_expr *expr, int init) gfc_constructor_append_expr (&cons->expr->value.constructor, para, &cons->expr->where); } + if (cons->expr->expr_type == EXPR_ARRAY) { - gfc_constructor *p; - p = gfc_constructor_first (cons->expr->value.constructor); - if (cons->expr->ts.u.cl != p->expr->ts.u.cl) - { - gfc_charlen *cl, *cl2; - - cl2 = NULL; - for (cl = gfc_current_ns->cl_list; cl; cl = cl->next) - { - if (cl == cons->expr->ts.u.cl) - break; - cl2 = cl; - } - - gcc_assert (cl); - - if (cl2) - cl2->next = cl->next; - - gfc_free_expr (cl->length); - free (cl); - } - + /* Rely on the cleanup of the namespace to deal correctly with + the old charlen. (There was a block here that attempted to + remove the charlen but broke the chain in so doing.) */ cons->expr->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); cons->expr->ts.u.cl->length_from_typespec = true; cons->expr->ts.u.cl->length = gfc_copy_expr (comp->ts.u.cl->length); |