From c2092deb7f2a90a56c44db0439ef60309e1e2d75 Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Mon, 16 Jul 2012 20:58:04 +0000 Subject: re PR fortran/53824 (ICE with ALLOCATE of coarrays) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2012-07-16 Thomas König PR fortran/53824 * resolve.c (resolve_allocate_deallocate): If both start indices are NULL, skip the test for equality. 2012-07-16 Thomas König PR fortran/53824 * gfortran.dg/coarray_allocate_1.f90: New test. From-SVN: r189549 --- gcc/fortran/resolve.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 03f74df..ab79460 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -7326,8 +7326,8 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn) } } - /* Check that an allocate-object appears only once in the statement. - FIXME: Checking derived types is disabled. */ + /* Check that an allocate-object appears only once in the statement. */ + for (p = code->ext.alloc.list; p; p = p->next) { pe = p->expr; @@ -7377,9 +7377,10 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn) { gfc_array_ref *par = &(pr->u.ar); gfc_array_ref *qar = &(qr->u.ar); - if (gfc_dep_compare_expr (par->start[0], - qar->start[0]) != 0) - break; + if ((par->start[0] != NULL || qar->start[0] != NULL) + && gfc_dep_compare_expr (par->start[0], + qar->start[0]) != 0) + break; } } else -- cgit v1.1