From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5935 invoked by alias); 13 Nov 2012 22:59:34 -0000 Received: (qmail 5897 invoked by uid 48); 13 Nov 2012 22:59:22 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements Date: Tue, 13 Nov 2012 22:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01205.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55314 --- Comment #1 from Thomas Koenig 2012-11-13 22:59:22 UTC --- Here's a tentative patch: Index: resolve.c =================================================================== --- resolve.c (Revision 192894) +++ resolve.c (Arbeitskopie) @@ -7618,12 +7618,18 @@ resolve_allocate_deallocate (gfc_code *code, const if (pr->next && qr->next) { + int i; gfc_array_ref *par = &(pr->u.ar); gfc_array_ref *qar = &(qr->u.ar); - if ((par->start[0] != NULL || qar->start[0] != NULL) - && gfc_dep_compare_expr (par->start[0], - qar->start[0]) != 0) - break; + + for (i=0; idimen; i++) + { + if ((par->start[i] != NULL + || qar->start[i] != NULL) + && gfc_dep_compare_expr (par->start[i], + qar->start[i]) != 0) + goto break_label; + } } } else @@ -7635,6 +7641,8 @@ resolve_allocate_deallocate (gfc_code *code, const pr = pr->next; qr = qr->next; } + break_label: + ; } } }