From aa08038dda94c80126a2ac54e8bab0964a95bf41 Mon Sep 17 00:00:00 2001 From: Erik Edelmann Date: Sun, 5 Mar 2006 19:24:48 +0000 Subject: re PR fortran/16136 (Conflicting attributes ALLOCATABLE, DUMMY (F2003)) fortran/ 2005-03-05 Erik Edelmann PR fortran/16136 * symbol.c (conf_std): New macro. (check_conflict): Use it to allow ALLOCATABLE dummy arguments for F2003. * trans-expr.c (gfc_conv_function_call): Pass the address of the array descriptor when dummy argument is ALLOCATABLE. * interface.c (compare_allocatable): New function. (compare_actual_formal): Use it. resolve.c (resolve_deallocate_expr, resolve_allocate_expr): Check that INTENT(IN) variables aren't (de)allocated. * gfortran.texi (Fortran 2003 status): List ALLOCATABLE dummy arguments as supported. testsuite/ 2005-03-05 Erik Edelmann PR fortran/16136 * allocatable_dummy_1.f90: New. * allocatable_dummy_2.f90: New. From-SVN: r111741 --- gcc/fortran/trans-expr.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9f5774b..1fc7f06 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1870,16 +1870,15 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, } else { - /* 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 or assumed shape, we do - not use g77's calling convention, and pass the - address of the array descriptor instead. Otherwise we - use g77's calling convention. */ + /* 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, + ALLOCATABLE or assumed shape, we do not use g77's calling + convention, and pass the address of the array descriptor + instead. Otherwise we use g77's calling convention. */ int f; f = (formal != NULL) - && !formal->sym->attr.pointer + && !(formal->sym->attr.pointer || formal->sym->attr.allocatable) && formal->sym->as->type != AS_ASSUMED_SHAPE; f = f || !sym->attr.always_explicit; if (arg->expr->expr_type == EXPR_VARIABLE -- cgit v1.1