Commit 97983742 by Paul Brook Committed by Paul Brook

re PR fortran/15314 (ICE caused by array initializer in derived type definition)

	PR fortran/15314
	* trans-expr.c (gfc_conv_structure): Use field type, not expr type.

From-SVN: r81816
parent 15342341
2004-05-13 Paul Brook <paul@codesourcery.com>
PR fortran/15314
* trans-expr.c (gfc_conv_structure): Use field type, not expr type.
2004-05-13 Joseph S. Myers <jsm@polyomino.org.uk> 2004-05-13 Joseph S. Myers <jsm@polyomino.org.uk>
* gfortran.texi: Use @table @emph instead of @itemize @emph. * gfortran.texi: Use @table @emph instead of @itemize @emph.
......
...@@ -1292,21 +1292,16 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init) ...@@ -1292,21 +1292,16 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
/* Evaluate the expression for this component. */ /* Evaluate the expression for this component. */
if (init) if (init)
{ {
switch (c->expr->expr_type) if (cm->dimension)
{ {
case EXPR_ARRAY:
arraytype = TREE_TYPE (cm->backend_decl); arraytype = TREE_TYPE (cm->backend_decl);
cse.expr = gfc_conv_array_initializer (arraytype, c->expr); cse.expr = gfc_conv_array_initializer (arraytype, c->expr);
break; }
else if (cm->ts.type == BT_DERIVED)
case EXPR_STRUCTURE:
gfc_conv_structure (&cse, c->expr, 1); gfc_conv_structure (&cse, c->expr, 1);
break; else
default:
gfc_conv_expr (&cse, c->expr); gfc_conv_expr (&cse, c->expr);
} }
}
else else
{ {
gfc_conv_expr (&cse, c->expr); gfc_conv_expr (&cse, c->expr);
......
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