aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-05-13 23:11:47 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-05-13 23:11:47 +0000
commit979837429d2eae3649dfa49b4cccde99f018a84f (patch)
tree856971393ad62f09764aa4f3cfdfb1d86371d618 /gcc/fortran/trans-expr.c
parent15342341aa4ade477abe31ccba4333d6dfc2956b (diff)
downloadgcc-979837429d2eae3649dfa49b4cccde99f018a84f.zip
gcc-979837429d2eae3649dfa49b4cccde99f018a84f.tar.gz
gcc-979837429d2eae3649dfa49b4cccde99f018a84f.tar.bz2
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
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 864b006..1f98f9e 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1292,20 +1292,15 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
/* Evaluate the expression for this component. */
if (init)
{
- switch (c->expr->expr_type)
+ if (cm->dimension)
{
- case EXPR_ARRAY:
arraytype = TREE_TYPE (cm->backend_decl);
cse.expr = gfc_conv_array_initializer (arraytype, c->expr);
- break;
-
- case EXPR_STRUCTURE:
- gfc_conv_structure (&cse, c->expr, 1);
- break;
-
- default:
- gfc_conv_expr (&cse, c->expr);
}
+ else if (cm->ts.type == BT_DERIVED)
+ gfc_conv_structure (&cse, c->expr, 1);
+ else
+ gfc_conv_expr (&cse, c->expr);
}
else
{