From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20275 invoked by alias); 31 Dec 2010 11:38:14 -0000 Received: (qmail 20266 invoked by uid 22791); 31 Dec 2010 11:38:13 -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; Fri, 31 Dec 2010 11:38:08 +0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47065] Replace trim(a) by a(1:len_trim(a)) X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement 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: --- 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: Fri, 31 Dec 2010 11:38: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: 2010-12/txt/msg03008.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47065 --- Comment #3 from Thomas Koenig 2010-12-31 11:38:03 UTC --- The most common cases are handled now. Still to do: - Handle substring references, for example trim(a(3:5)). Here, we have to watch out for trim(a(function(x):5)), not to evaluate the function twice. - Right now, the optimization is not applied in argument lists. This can be relaxed for PURE functions and subroutines, or if dependency analysis shows that it cannot hurt. The latter point is probably not worth it.