From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18656 invoked by alias); 22 Nov 2011 20:22:39 -0000 Received: (qmail 18647 invoked by uid 22791); 22 Nov 2011 20:22:38 -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; Tue, 22 Nov 2011 20:22:24 +0000 From: "priv123 at hotmail dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51267] loop optimization error using LOC function Date: Tue, 22 Nov 2011 20:55: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: priv123 at hotmail dot fr 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: 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: 2011-11/txt/msg02251.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51267 --- Comment #2 from Mathieu 2011-11-22 20:22:15 UTC --- Sure, and we are especially fans of -fbound-checks but we can not use it on half of the code because of this usage. For the story : { I reproduced here with this small code a part of the 1.e6 lines of our code (see www.code-aster.org for more interest). It's 20 years old but it's always evolving every week. This usage (with an array allocated elsewhere and used in read/write using an offset computed by LOC) allowed to simulate dynamic allocations and out-of-core memory management in f77. So if we are working to use current allocation management it requires to change a lot of lines of code and the refactoring will be done part by part... } And just try this, it works : c do 12 i=1,3*n c ius(iad+i) = -1 c 12 continue but not the unrolled loop. That's why I think that the optimizer fails on that loop (and probably only when the array of dimension(1)). Do you know what does change between 4.5 and 4.6 that can explain the difference of behavior ? Any option to tune the behavior ? Thx