https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128042
--- Comment #6 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
Even simpler:
program test
implicit none
type tag3
character(4) :: c3(3) = ""
end type tag3
! type(tag3), parameter :: u = tag3(['opqr','strv']) ! works
type(tag3), parameter :: u = tag3( 'opqr' ) ! fails
integer, parameter :: m = storage_size (u) / 8
character(m) :: vv
vv = transfer(u,vv)
print *, vv
end
This prints:
opqr^@^@^@^@^@^@^@^@
Debugging shows that when the initializer for the DT component is a scalar,
and the DT component is an array, gfc_target_encode_expr processes a too
short expr.
I've tried to fix up the constructor initializing the component, but haven't
succeeded so far.