This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34083] internal compiler error: in gfc_conv_array_constructor_expr, at fortran/trans-expr.c:2819
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2007 13:53:53 -0000
- Subject: [Bug fortran/34083] internal compiler error: in gfc_conv_array_constructor_expr, at fortran/trans-expr.c:2819
- References: <bug-34083-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-11-21 13:53 -------
It's fixed by the simple patch below:
Index: resolve.c
===================================================================
--- resolve.c (revision 130234)
+++ resolve.c (working copy)
@@ -740,6 +740,8 @@ resolve_structure_cons (gfc_expr *expr)
for (; comp; comp = comp->next, cons = cons->next)
{
+ int rank;
+
if (!cons->expr)
continue;
@@ -749,14 +751,14 @@ resolve_structure_cons (gfc_expr *expr)
continue;
}
- if (cons->expr->expr_type != EXPR_NULL
- && comp->as && comp->as->rank != cons->expr->rank
+ rank = comp->as ? comp->as->rank : 0;
+ if (cons->expr->expr_type != EXPR_NULL && rank != cons->expr->rank
&& (comp->allocatable || cons->expr->rank))
{
gfc_error ("The rank of the element in the derived type "
"constructor at %L does not match that of the "
"component (%d/%d)", &cons->expr->where,
- cons->expr->rank, comp->as ? comp->as->rank : 0);
+ cons->expr->rank, rank);
t = FAILURE;
}
I'll regtest and submit later this week.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-11-13 15:44:50 |2007-11-21 13:53:53
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34083