From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62380 invoked by alias); 20 Mar 2015 09:53:08 -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 62323 invoked by uid 55); 20 Mar 2015 09:53:04 -0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64164] [4.9/5 Regression] one more stack slot used due to one less inlining level Date: Fri, 20 Mar 2015 10:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: aoliva at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 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-03/txt/msg02073.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164 --- Comment #23 from rguenther at suse dot de --- On Fri, 20 Mar 2015, law at redhat dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64164 > > --- Comment #22 from Jeffrey A. Law --- > Let's try to stay focused. Killing copyrename seems like a fine thing to do as > long as the resulting debug info is good. But that's independent of this BZ. > > I still find myself wondering if leaving the "0" instead of "_10" in that PHI > node is a reasonable approach. Certainly if I hack uncprop to leave things in > that state, I get the code we want. > > And ISTM that uncprop ought to leave the constant alone if the SSA_NAME holding > the constant conflicts with any of the other SSA_NAMEs in the PHI node that may > potentially coalesce with the PHI result. That captures pretty well the case > where the constant is better than an SSA_NAME. > > In this particular case, we have: > > # _28 = PHI <0(2), _29(3), _29(7), _10(8), _29(6)> > > When _28 and _10 coalesce, the result then conflicts with _29 during IRA/LRA > because of the extended lifetime of _10). Thus the annoying copies created by > out-of-ssa can't be eliminated. > > WIth the proposed change, we'd instead have: > > # _28 = PHI <0(2), _29(3), _29(7), 0(8), _29(6)> > > While we won't coalesce _28/_29 during out-of-ssa, LRA will see the copies and > note that the associated pseudos don't conflict and ultimately assign them to > the same hard register and the annoying copies are gone. Sure - but then we'd better integrate uncprop into the coalescing, otherwise you need to re-compute conflicts / live twice.