From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20220 invoked by alias); 20 Jul 2012 19:59:30 -0000 Received: (qmail 20211 invoked by uid 22791); 20 Jul 2012 19:59:29 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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, 20 Jul 2012 19:59:16 +0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/53787] Possible IPA-SRA / IPA-CP improvement Date: Fri, 20 Jul 2012 19:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status AssignedTo 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-07/txt/msg01669.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53787 Martin Jambor changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |ASSIGNED AssignedTo|unassigned at gcc dot |jamborm at gcc dot gnu.org |gnu.org | --- Comment #8 from Martin Jambor 2012-07-20 19:59:02 UTC --- (In reply to comment #6) > This has nothing to do with LTO - with a single compilation unit you can > use -fwhole-program. The issue is that Fortran passes parameters by reference > and our interprocedural constant-propagation pass does not know how to deal > with that. The IPA SRA pass which is supposed to "fix" that decides that > init cannot have its signature changed. Martin, can you check why? > I think we ought to optimize this with -O3 -fwhole-program -fno-inline. IPA-SRA is not really an IPA pass and even with -fwhole-program it cannot change signatures of functions which might be called from other compilation units (without creating clones). In the testcase, _init is called by MAIN in the following way: integer(kind=4) n; : n = 10; init_ (&x, &n); Now if we could somehow propagate &10 into the actual argument of the call statement, IPA-CP should pick it up and propagate it into the caller. Another alternative is to construct an aggregate jump function for it when we have them. I'll keep this testcase in mind when working on them.