>From the Meissner example Window (Ising model), this line
print '(" ", I6, 64 A1)', L**3, Merge ("+", "-", Ising(: 4, : 4, : 4) == 1)
causes
meissner10.f90: In function MAIN__:
meissner10.f90:18: internal compiler error: in gfc_conv_expr_descriptor, at
fortran/trans-array.c:3815
The ICE is due to this patch:
http://gcc.gnu.org/ml/gcc-cvs/2005-09/msg00961.html
I did not catch it because I had passed this patch by, working on trans-io.c,
as it does. *sigh*
Specifically, the call from trans-io.c(gfc_trans_transfer):
...snip
else
{
/* Pass the array descriptor to the library. */
gfc_conv_expr_descriptor (&se, expr, ss);
tmp = gfc_build_addr_expr (NULL, se.expr);
transfer_array_desc (&se, &expr->ts, tmp);
}
...snip
is the cause of the problem.
A potential patch (well it works!) is
*** gcc/gcc/fortran/trans-io.c.orig Tue Oct 11 14:18:51 2005
--- gcc/gcc/fortran/trans-io.c Tue Oct 11 14:18:31 2005
*************** gfc_trans_transfer (gfc_code * code)
*** 1637,1643 ****
gfc_conv_expr_reference (&se, expr);
transfer_expr (&se, &expr->ts, se.expr);
}
! else if (expr->ts.type == BT_DERIVED)
{
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
--- 1637,1643 ----
gfc_conv_expr_reference (&se, expr);
transfer_expr (&se, &expr->ts, se.expr);
}
! else if (expr->ts.type == BT_DERIVED || (expr->ts.type == BT_CHARACTER &&
expr->ts.cl == NULL))
{
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
I am looking for a more elegant solution or, at least, a cleaner detection of
the error.
--
Summary: Regression: ICE when MERGE is used with character args
in a PRINT/WRITE statement
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pault at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24311