------- Comment #3 from andrea dot bedini at gmail dot com 2006-01-10 00:02 ------- In gfc_conv_component_ref line 280 I read
if (c->ts.type == BT_CHARACTER) { tmp = c->ts.cl->backend_decl; /* Components must always be constant length. */ gcc_assert (tmp && INTEGER_CST_P (tmp)); se->string_length = tmp; } but at that time (gdb) print *c $1 = {name = 0x10b3e155 "coo", ts = {type = BT_CHARACTER, kind = 1, derived = 0x0, cl = 0x10b3fa88}, pointer = 0, dimension = 0, as = 0x0, backend_decl = 0x301c1070, loc = {nextc = 0x0, lb = 0x0}, initializer = 0x0, next = 0x0} (gdb) print *c.ts.cl $2 = {length = 0x10b54f08, next = 0x0, backend_decl = 0x0, resolved = 1} (gdb) print *c.ts.cl.length $3 = {expr_type = EXPR_CONSTANT, ts = {type = BT_INTEGER, kind = 4, derived = 0x0, cl = 0x0}, rank = 0, shape = 0x0, symtree = 0x0, ref = 0x0, where = {nextc = 0x10b3a6a0 "", lb = 0x10b3a680}, from_H = 0, inline_noncopying_intrinsic = 0, value = {logical = 2, integer = {{_mp_alloc = 2, _mp_size = 1, _mp_d = 0x10b20ca0}}, real = {{_mpfr_prec = 2, _mpfr_sign = 1, _mpfr_exp = 280104096, _mpfr_d = 0x0}}, complex = {r = {{_mpfr_prec = 2, _mpfr_sign = 1, _mpfr_exp = 280104096, _mpfr_d = 0x0}}, i = {{_mpfr_prec = 0, _mpfr_sign = 0, _mpfr_exp = 0, _mpfr_d = 0x0}}}, op = {operator = INTRINSIC_PLUS, uop = 0x1, op1 = 0x10b20ca0, op2 = 0x0}, function = {actual = 0x2, name = 0x1 <Address 0x1 out of bounds>, isym = 0x10b20ca0, esym = 0x0}, character = {length = 2, string = 0x1 <Address 0x1 out of bounds>}, constructor = 0x2}} so c->ts.cl->backend_decl is 0 and then the ICE, calling gfc_conv_const_charlen(c->ts.cl) just before the length check seems to work (but I really don't know what I'm talking about). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25730