aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2009-11-03 17:51:52 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2009-11-03 17:51:52 +0100
commit64c2f8defe31677024073ed70b5fbdbc52d0bff4 (patch)
tree5f727c5c8d300e304725254cbdfbb8e159383810 /gcc/fortran/trans-expr.c
parent9595a419c6d743670f8554b8771156d508983efc (diff)
downloadgcc-64c2f8defe31677024073ed70b5fbdbc52d0bff4.zip
gcc-64c2f8defe31677024073ed70b5fbdbc52d0bff4.tar.gz
gcc-64c2f8defe31677024073ed70b5fbdbc52d0bff4.tar.bz2
re PR fortran/41907 (465.tonto in SPEC CPU 2006 runtime failure)
2009-11-03 Tobias Burnus <burnus@net-b.de> PR fortran/41907 * trans-expr.c (gfc_conv_procedure_call): Fix presence check for optional arguments. 2009-11-03 Tobias Burnus <burnus@net-b.de> PR fortran/41907 * gfortran.dg/missing_optional_dummy_6.f90: New test. From-SVN: r153854
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index d8f8303..5a45f4f 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2998,16 +2998,19 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
only needed when passing an array to an elemental procedure
as then array elements are accessed - or no NULL pointer is
allowed and a "1" or "0" should be passed if not present.
- When passing a deferred array to a non-deferred array dummy,
- the array needs to be packed and a check needs thus to be
- inserted. */
+ When passing a non-array-descriptor full array to a
+ non-array-descriptor dummy, no check is needed. For
+ array-descriptor actual to array-descriptor dummy, see
+ PR 41911 for why a check has to be inserted.
+ fsym == NULL is checked as intrinsics required the descriptor
+ but do not always set fsym. */
if (e->expr_type == EXPR_VARIABLE
&& e->symtree->n.sym->attr.optional
&& ((e->rank > 0 && sym->attr.elemental)
|| e->representation.length || e->ts.type == BT_CHARACTER
- || (e->rank > 0 && (fsym == NULL
- || (fsym->as->type != AS_ASSUMED_SHAPE
- && fsym->as->type != AS_DEFERRED)))))
+ || (e->rank > 0
+ && (fsym == NULL || fsym->as->type == AS_ASSUMED_SHAPE
+ || fsym->as->type == AS_DEFERRED))))
gfc_conv_missing_dummy (&parmse, e, fsym ? fsym->ts : e->ts,
e->representation.length);
}