http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51434
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code CC| |burnus at gcc dot gnu.org Summary|internal compiler error |ICE with scalar init of an | |array parameter, used in DT | |default init with transfer --- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-06 08:53:24 UTC --- Reduced test case. The TYPE is crucial - if "t" is just an initialization to a module variable, no ICE occurs. character, parameter :: s(5) = 'a' type b character :: t(5) = transfer('abc ', s) ! << ICE end type !type(b) :: x !print *, x%t ! shall print "abc " !print *, s ! prints successfully "aaaaa" end ==14250== Invalid read of size 8 ==14250== at 0x51A7CD: gfc_match_data_decl() (decl.c:1589) ==14250== by 0x55F429: _ZL10match_wordPKcPF5matchvEP5locus.part.3 (parse.c:65) ==14250== by 0x55FC39: decode_statement() (parse.c:283) That's the line: else if (mpz_cmp (c->ts.u.cl->length->value.integer, c->initializer->ts.u.cl->length->value.integer)) with c->initializer->ts.u.cl == NULL