From patchwork Wed Sep 18 18:30:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 275776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 04CFD2C00F4 for ; Thu, 19 Sep 2013 04:30:58 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=WZ1LMYqdWHzcMrCmx igz97TUMRthsMGqDnlCr1agRv4tx/LTHNRa9OBi7Se8KIu2jYTSWQsA7rQszGhwG 2Stt40BY1TlEqSSXsspEUeNNkaiSeQeThrjMJpzLMRlYXVkXDxFvEZjxtQaG7E5y 6ioMmo6c0iSLb3Ma1LLOdoIiu4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=NFbsys53W8FH+Ct/fkjYbc5 c2lk=; b=EQ9itiYxULRYLdiO/l6CGidfKcudqB3c+wN+rBEeRhU0tADdwZ9fWA8 8/LxhmFFEYPHjgvOAtWt6QUh6h7Cg0NWR3J71wwBUcw+a/9pXarsTMBYqJ6OgaFY qMUwYzntFUIdCd1KPccKvgykXweE0HFVM0ppMNVOvbfyetJptIP0= Received: (qmail 30526 invoked by alias); 18 Sep 2013 18:30:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30514 invoked by uid 89); 18 Sep 2013 18:30:52 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 18:30:52 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8IIUnAP000437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Sep 2013 14:30:49 -0400 Received: from topor.usersys.redhat.com ([10.15.16.142]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8IIUnSX027071 for ; Wed, 18 Sep 2013 14:30:49 -0400 Message-ID: <5239F158.3020907@redhat.com> Date: Wed, 18 Sep 2013 14:30:48 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: gcc-patches Subject: Re: patch to fix PR58335 References: <52320776.8010208@redhat.com> In-Reply-To: <52320776.8010208@redhat.com> X-IsSubscribed: yes On 09/12/2013 02:27 PM, Vladimir Makarov wrote: > The following patch fixes > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58335 > > It required to implement a new approach for elimination updates for > insn frame_pointer = hard_frame_pointer + offset. The previous > implementation used parsing insns generated for offset elimination for > given insn. It is hard to parse all possible variants for such > elimination on different targets. For example, s390 code is quite > different from x86/x86-64 code and that was the reason for the PR. > The new implementation uses temporarily REG_EQUAL notes to avoid > generated insns > parsing. It solves the problem and makes LRA more portable. > > The patch was successfully bootstrapped and tested on x86/x86-64 and s390. > > Committed as rev. 202536. It is actually 202714. > > 2013-09-12 Vladimir Makarov > > PR middle-end/58335 > * lra-eliminations.c (remove_reg_equal_offset_note): New. > (eliminate_regs_in_insn): Rewrite frame pointer to hard frame > pointer elimination with using remove_reg_equal_offset_note. > Sorry, I missed to commit the test suite. The patch is in attachment. Committed as rev. 202715. Index: testsuite/g++.dg/pr58438.C =================================================================== --- testsuite/g++.dg/pr58438.C (revision 0) +++ testsuite/g++.dg/pr58438.C (working copy) @@ -0,0 +1,45 @@ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-march=amdfam10 -O3 -fprofile-generate" } */ +enum gimple_code {}; +struct A { + gimple_code code; +}; +struct B { + A gsbase; +}; +int **a; +int b, d, e, f, g, h, i, j, k, l, m, n, o; +gimple_code c, p; +class C { + virtual unsigned m_fn1(); +}; +B q; +static int fn1() { + int r; + if (k) + i = 0; + for (; i; j++) { + b = c <= 0; + if (b) + n = *a[0]; + b = p && c; + if (b) + r = *a[0]; + b = q.gsbase.code && c; + if (b) + o = *a[0]; + m = o; + if (e || 1 & r || d || l) + return 0; + } +} + +class D : C { + unsigned m_fn1() { + fn1(); + for (; h; g++) + for (;; f++) + ; + } +}; +void fn2() { new D; }