------- Comment #5 from dfranke at gcc dot gnu dot org  2010-07-08 20:13 -------
(In reply to comment #4)
> I'd hazard the guess that some string length is not properly copied somewhere.

  Type :: t
    character (len=X) :: txt(2)
  End Type
  Type (t) :: tt = t((/ "12345", "67890" /))
  print *, tt
End

             compilation                       output
X=3, 4.5      ok, but no truncation warning    "123678"
X=3, trunk    ok, but no truncation warning    "1236"     <-- wrong

X=5, 4.5      ok                               "1234567890"
X=5, trunk    ok                               "1234567890"

X=7, 4.5      ok                               "1234567890" <-- wrong?
X=7, trunk    ICE

In the last case, I'd expect the output "12345  67890  " - is 4.5 wrong here?

Possibly related functions:
  resolve.c (resolve_structure_cons)
  array.c (gfc_resolve_character_array_constructor)
  decl.c (gfc_set_constant_character_len)

Possibly related PR:
  PR42526


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44857

Reply via email to