https://gcc.gnu.org/g:ca8afb6caf9f9eb7fe76df5313c30ae9d2d58c60
commit ca8afb6caf9f9eb7fe76df5313c30ae9d2d58c60 Author: Mikael Morin <[email protected]> Date: Thu Oct 15 14:00:41 2026 +0200 Correction partielle optional_absent_1 Diff: --- gcc/fortran/trans-expr.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index 7ec742b15c51..5d5c190e4fca 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -5913,8 +5913,13 @@ class_array_fcn: present_var = gfc_create_var (boolean_type_node, "present"); /* present_var = present(sym); . */ - tmp = gfc_conv_expr_present (sym); - tmp = fold_convert (boolean_type_node, tmp); + if (sym->attr.optional) + { + tmp = gfc_conv_expr_present (sym); + tmp = fold_convert (boolean_type_node, tmp); + } + else + tmp = boolean_true_node; if (fsym && ((fsym->ts.type == BT_CLASS && fsym->ts.u.derived->attr.is_class
