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/ChangeLog | 6 ++++++ gcc/fortran/resolve.c | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5759d1b..c080e5a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +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 Steven Bosscher * f95-lang.c: Include dumpfile.h instead of tree-dump.h. 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