aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2024-09-27 14:18:42 +0200
committerAndre Vehreschild <vehre@gcc.gnu.org>2024-09-30 09:18:50 +0200
commitbac95615b50d4a012c448cba080c106702184e3a (patch)
tree1adf2c5d19fc716820076875069cb99586b96ded /gcc/fortran
parent71bf3daa8dabe45aa14e7315195a70ad0d883337 (diff)
downloadgcc-bac95615b50d4a012c448cba080c106702184e3a.zip
gcc-bac95615b50d4a012c448cba080c106702184e3a.tar.gz
gcc-bac95615b50d4a012c448cba080c106702184e3a.tar.bz2
Ensure coarrays in calls use a descriptor [PR81265]
gcc/fortran/ChangeLog: PR fortran/81265 * trans-expr.cc (gfc_conv_procedure_call): Ensure coarrays use a descriptor when passed. gcc/testsuite/ChangeLog: * gfortran.dg/coarray/pr81265.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/trans-expr.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index e4c491a..9f223a1 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -6438,11 +6438,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
{
bool finalized = false;
tree derived_array = NULL_TREE;
+ symbol_attribute *attr;
e = arg->expr;
fsym = formal ? formal->sym : NULL;
parm_kind = MISSING;
+ attr = fsym ? &(fsym->ts.type == BT_CLASS ? CLASS_DATA (fsym)->attr
+ : fsym->attr)
+ : nullptr;
/* If the procedure requires an explicit interface, the actual
argument is passed according to the corresponding formal
argument. If the corresponding formal argument is a POINTER,
@@ -6458,7 +6462,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
if (comp)
nodesc_arg = nodesc_arg || !comp->attr.always_explicit;
else
- nodesc_arg = nodesc_arg || !sym->attr.always_explicit;
+ nodesc_arg
+ = nodesc_arg
+ || !(sym->attr.always_explicit || (attr && attr->codimension));
/* Class array expressions are sometimes coming completely unadorned
with either arrayspec or _data component. Correct that here.