Add missing gfc_init_se call for the default initializer case in
ALLOCATE_PDT_COMP. The adjacent KIND/LEN block (line 11118) and
pdt_string block (line 11149) both initialize tse, but this block
left it uninitialized, causing undefined behavior when tse.ss
contained stack garbage. Exposed as an ICE in gfc_conv_constant
(trans-const.cc:425) on aarch64 with LTO bootstrap.
PR fortran/123949
gcc/fortran/ChangeLog:
* trans-array.cc (structure_alloc_comps): Add missing
gfc_init_se call in case ALLOCATE_PDT_COMP for scalar
component default initializer.
Signed-off-by: Christopher Albert <albert@tugraz.at>
{
gfc_se tse;
gfc_expr *c_expr;
+ gfc_init_se (&tse, NULL);
c_expr = c->initializer;
gfc_conv_expr_type (&tse, c_expr, TREE_TYPE (comp));
gfc_add_block_to_block (&fnblock, &tse.pre);