https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117643
--- Comment #14 from kargls at comcast dot net --- (In reply to Jerry DeLisle from comment #12) > The following additional patch from Harald posted on the gfortran list: > > https://gcc.gnu.org/pipermail/fortran/2024-December/061452.html > > diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc > index 2370b6dad55..886f999f206 100644 > --- a/gcc/fortran/trans-intrinsic.cc > +++ b/gcc/fortran/trans-intrinsic.cc > @@ -10220,6 +10220,16 @@ conv_isocbinding_function (gfc_se *se, gfc_expr > *expr) > > gfc_init_se (&asis_se, se); > gfc_conv_expr (&asis_se, asis); > + if (asis->expr_type == EXPR_VARIABLE > + && asis->symtree->n.sym->attr.dummy > + && asis->symtree->n.sym->attr.optional) > + { > + tree present = gfc_conv_expr_present (asis->symtree->n.sym); > + asis_se.expr = build3_loc (input_location, COND_EXPR, > + logical_type_node, present, > + asis_se.expr, > + build_int_cst > (logical_type_node, 0)); > + } > gfc_add_block_to_block (&se->pre, &asis_se.pre); > tmp = fold_build3_loc (input_location, COND_EXPR, > void_type_node, > asis_se.expr, then_branch, else_branch); > > I will put this altogether in one patch. > > Steve, any further comments? No comments from me. I'm still trying to determine how gfc_conv_expr_present() works, and what 'gfc_conv_expr (&asis_se, asis)' gives when the optional argument is not present. If Harald signs off on the patch, the ChangeLog should likely note the group effort that went into the patch as Mikael, FX, and Harald deserve some recognition (or blame!).