From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29858 invoked by alias); 27 Jun 2011 17:23:33 -0000 Received: (qmail 29849 invoked by uid 22791); 27 Jun 2011 17:23:32 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM 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; Mon, 27 Jun 2011 17:23:19 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49540] [4.6/4.7 Regression] Memory-hog with large DATA stmt X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: memory-hog 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: 4.6.2 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 Date: Mon, 27 Jun 2011 17:23: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-06/txt/msg02621.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49540 --- Comment #7 from Tobias Burnus 2011-06-27 17:22:15 UTC --- (In reply to comment #6) > (In reply to comment #2) > > Thus, in some way, the repeat count must come back. One possibility is to > > handle the special case /*/, which is equivalent to > > a scalar initialization. I think that should cover the most common case. > > IIRC, as implemented the array constructor is completely unrolled, for each > element an entry in the splay tree is generated. Yes - at least since dropping the repeat count, which your patch did. > One could apply the -fmax-array-constructor= restrictions used e.g. for > PARAMETER arrays and do not unroll arrays of size larger than but do it > on runtime. As written, I think it should be sufficient to support the initialization via a scalar. In terms of the trans*.c files that already works: real :: a(3) = 0 thus, there is no reason why one should be able to set sym->value also for real a(3) data a/3*0/ That is: If - and only if - one has == size(array), i.e. a whole-array initialization, one changes the initialization from: sym->value = [ ( , i = 1, ) ] to sym->value = That should require some reshoveling in the code, but sounds much cleaner as -fmax-array-constructor= tweaking. Additionally, it will generate much faster code for "data a/10000000*0.0/" as it gets translated into "static real a = {}".