aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2025-03-03 10:41:05 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2025-03-04 09:38:14 +0100
commitef605e106c6075bfe2a5625add7185a9a3f722b1 (patch)
treec9214455af56234470e6c7ab779d9f97b69d115d /gcc
parent10e4107dfcf9fe324d0902f16411a75c596dab91 (diff)
downloadgcc-ef605e106c6075bfe2a5625add7185a9a3f722b1.zip
gcc-ef605e106c6075bfe2a5625add7185a9a3f722b1.tar.gz
gcc-ef605e106c6075bfe2a5625add7185a9a3f722b1.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/trans-expr.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index e619013..7c0b174 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;