Commit c3879be1 by Paul Thomas

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
parent c0140e3c
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.
2016-12-09 Paul Thomas <pault@gcc.gnu.org> 2016-12-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/77903 PR fortran/77903
......
...@@ -1257,31 +1257,12 @@ resolve_structure_cons (gfc_expr *expr, int init) ...@@ -1257,31 +1257,12 @@ resolve_structure_cons (gfc_expr *expr, int init)
gfc_constructor_append_expr (&cons->expr->value.constructor, gfc_constructor_append_expr (&cons->expr->value.constructor,
para, &cons->expr->where); 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; if (cons->expr->expr_type == EXPR_ARRAY)
for (cl = gfc_current_ns->cl_list; cl; cl = cl->next)
{ {
if (cl == cons->expr->ts.u.cl) /* Rely on the cleanup of the namespace to deal correctly with
break; the old charlen. (There was a block here that attempted to
cl2 = cl; remove the charlen but broke the chain in so doing.) */
}
gcc_assert (cl);
if (cl2)
cl2->next = cl->next;
gfc_free_expr (cl->length);
free (cl);
}
cons->expr->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL); 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_from_typespec = true;
cons->expr->ts.u.cl->length = gfc_copy_expr (comp->ts.u.cl->length); cons->expr->ts.u.cl->length = gfc_copy_expr (comp->ts.u.cl->length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment