https://gcc.gnu.org/g:1fbfdc05bad1a38d1ce1cab600b495aea546acfc
commit 1fbfdc05bad1a38d1ce1cab600b495aea546acfc Author: Mikael Morin <[email protected]> Date: Thu Jan 16 20:45:34 2025 +0100 Essai suppression unlimited_polymorphic Diff: --- gcc/fortran/trans-array.cc | 9 +++++---- gcc/fortran/trans.h | 3 --- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 3e3e88012efd..9afffb49f2c2 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -2769,6 +2769,10 @@ trans_array_constructor (gfc_ss * ss, locus * where) mpz_clear (size); } + bool unlimited_polymorphic = false; + if (!se->direct_byref) + unlimited_polymorphic = UNLIMITED_POLY (expr); + /* Special case constant array constructors. */ if (!dynamic) { @@ -8173,9 +8177,6 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) expr = expr->value.function.actual->expr; } - if (!se->direct_byref) - se->unlimited_polymorphic = UNLIMITED_POLY (expr); - /* Special case things we know we can pass easily. */ switch (expr->expr_type) { @@ -8626,7 +8627,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) the offsets because all elements are within the array data. */ /* Set the dtype. */ - if (se->unlimited_polymorphic) + if (unlimited_polymorphic) dtype = gfc_get_dtype (TREE_TYPE (desc), &loop.dimen); else if (expr->ts.type == BT_ASSUMED) { diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index bcb466ffe8ff..73a6def50e16 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -61,9 +61,6 @@ typedef struct gfc_se the reference to the class object here. */ tree class_container; - /* Whether expr is a reference to an unlimited polymorphic object. */ - unsigned unlimited_polymorphic:1; - /* If set gfc_conv_variable will return an expression for the array descriptor. When set, want_pointer should also be set. If not set scalarizing variables will be substituted. */
