Correction régression deferred_character_27.f90

This commit is contained in:
Mikael Morin 2025-10-16 13:06:50 +02:00
parent 5f8e0bb6eb
commit a6df2739cb
2 changed files with 9 additions and 2 deletions

View File

@ -1025,9 +1025,15 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_ss * ss,
if (eltype && GFC_CLASS_TYPE_P (eltype))
eltype = gfc_get_element_type (TREE_TYPE (TYPE_FIELDS (eltype)));
if (class_expr == NULL_TREE)
if (class_expr == NULL_TREE
&& TYPE_SIZE_UNIT (eltype) != NULL_TREE)
elemsize = fold_convert (gfc_array_index_type,
TYPE_SIZE_UNIT (eltype));
else if (class_expr == NULL_TREE)
{
gcc_assert (callee_alloc);
elemsize = NULL_TREE;
}
else
{
/* Unlimited polymorphic entities are initialised with NULL vptr. They

View File

@ -2921,6 +2921,7 @@ gfc_set_temporary_descriptor (stmtblock_t *block, tree descr, tree class_src,
ubound[n], stride[n], &offset);
}
if (elemsize != NULL_TREE)
gfc_conv_descriptor_span_set (block, descr, elemsize);
gfc_conv_descriptor_offset_set (block, descr, offset);