From: Andre Vehreschild Date: Mon, 3 Mar 2025 09:41:05 +0000 (+0100) Subject: Fortran: Reduce code complexity [PR77872] X-Git-Tag: basepoints/gcc-16~1750 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef605e106c6075bfe2a5625add7185a9a3f722b1;p=thirdparty%2Fgcc.git Fortran: Reduce code complexity [PR77872] PR fortran/77872 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Use attr instead of doing type check and branching for BT_CLASS. --- diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index e619013f261..7c0b17428cd 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -8216,23 +8216,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* For descriptorless coarrays and assumed-shape coarray dummies, we pass the token and the offset as additional arguments. */ if (fsym && e == NULL && flag_coarray == GFC_FCOARRAY_LIB - && ((fsym->ts.type != BT_CLASS && fsym->attr.codimension - && !fsym->attr.allocatable) - || (fsym->ts.type == BT_CLASS - && CLASS_DATA (fsym)->attr.codimension - && !CLASS_DATA (fsym)->attr.allocatable))) + && attr->codimension && !attr->allocatable) { /* Token and offset. */ vec_safe_push (stringargs, null_pointer_node); vec_safe_push (stringargs, build_int_cst (gfc_array_index_type, 0)); gcc_assert (fsym->attr.optional); } - else if (fsym && flag_coarray == GFC_FCOARRAY_LIB - && ((fsym->ts.type != BT_CLASS && fsym->attr.codimension - && !fsym->attr.allocatable) - || (fsym->ts.type == BT_CLASS - && CLASS_DATA (fsym)->attr.codimension - && !CLASS_DATA (fsym)->attr.allocatable))) + else if (fsym && flag_coarray == GFC_FCOARRAY_LIB && attr->codimension + && !attr->allocatable) { tree caf_decl, caf_type, caf_desc = NULL_TREE; tree offset, tmp2;