From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17463 invoked by alias); 23 Jan 2011 22:39:49 -0000 Received: (qmail 17452 invoked by uid 22791); 23 Jan 2011 22:39:48 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 23 Jan 2011 22:39:44 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47425] New: Array constructor with type-spec: Fails with more complicated length type expr X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 24 Jan 2011 00:57:00 -0000 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: 2011-01/txt/msg02402.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47425 Summary: Array constructor with type-spec: Fails with more complicated length type expr Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/397b3520a4dd1a9f# James Van Buskirk found an example for an Array constructor with type-spec, which fails at gimpling. Full example: See c.l.f. Short example: subroutine sub1(L,s,e) implicit none character(*) L integer s,e if(any(L(s:e+1) == [character(len(L(s:e))+1)::'that','those'])) then end if end subroutine sub1 Gives: test.f90:5:0: error: size of variable 'A.1' is too large Looking at the dump, one sees that the character length is strangely optimized away into two uninitialized variables. The dump has: sub1 (character(kind=1)[1:_l] & restrict l, integer(kind=4) & restrict s, integer(kind=4) & restrict e, integer(kind=4) _l) { bit_size_type D.1546; D.1547; D.1546 = (bit_size_type) (() _l * 8); D.1547 = () (_l + -1) + 1; { static character(kind=1) A.1[2][1:MAX_EXPR <(D.1541 - D.1540) + 1, 0> + 1] = {"that", "those"}; and only much later: D.1540 = *s; D.1541 = *e;