[gcc(refs/users/mikael/heads/refactor_descriptor_v05)] Renseignement spacing pour les tableaux constants
Mikael Morin
mikael@gcc.gnu.org
Fri Jun 13 14:56:08 GMT 2025
https://gcc.gnu.org/g:48c38d2385afc69003398d75a5b26de31484da19
commit 48c38d2385afc69003398d75a5b26de31484da19
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Thu Apr 17 14:38:11 2025 +0200
Renseignement spacing pour les tableaux constants
Diff:
---
gcc/fortran/trans-array.cc | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 5729a43c4b60..1d76b86d0040 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -4579,7 +4579,6 @@ done:
}
/* FALLTHRU */
- case GFC_SS_CONSTRUCTOR:
case GFC_SS_FUNCTION:
for (n = 0; n < ss->dimen; n++)
{
@@ -4592,6 +4591,30 @@ done:
}
break;
+ case GFC_SS_CONSTRUCTOR:
+ {
+ gcc_assert (info->shape != nullptr);
+ tree type = gfc_typenode_for_spec (&ss_info->expr->ts);
+ tree spacing = fold_convert_loc (input_location,
+ gfc_array_index_type,
+ TYPE_SIZE_UNIT (type));
+ for (n = 0; n < ss->dimen; n++)
+ {
+ int dim = ss->dim[n];
+
+ info->start[dim] = gfc_index_zero_node;
+ info->end[dim] = gfc_index_zero_node;
+ info->stride[dim] = gfc_index_one_node;
+ info->spacing[dim] = spacing;
+ tree extent = gfc_conv_mpz_to_tree_type (info->shape[n],
+ gfc_array_index_type);
+ spacing = fold_build2_loc (input_location, MULT_EXPR,
+ gfc_array_index_type, spacing,
+ extent);
+ }
+ }
+ break;
+
default:
break;
}
More information about the Gcc-cvs
mailing list