From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57360 invoked by alias); 25 Sep 2015 12:58:31 -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 Received: (qmail 57312 invoked by uid 48); 25 Sep 2015 12:58:26 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67170] PRE can't hoist out a readonly argument Date: Fri, 25 Sep 2015 12:58: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-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg02014.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67170 --- Comment #8 from Richard Biener --- I wonder why IPA SRA doesn't turn the scalar parameter from by-reference to by-value passing btw. I do see that IPA SRA doesn't handle recursion though, thus static int __attribute__((noinline)) foo (int *p) { if (*p) return foo (p); return *p; } int main() { int i = 0; return foo (&i); } is not transformed. But in the testcase there isn't a recursive call using the incoming parameter. As for the idea to use the alias machinery I'm now leaning towards either having PTA compute a "points-to-readonly" or SCCVN/LIM pre-compute the parm-decl property and have its own disambiguator handle the disambiguation.