From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2303 invoked by alias); 1 Jul 2010 08:13:25 -0000 Received: (qmail 2289 invoked by uid 22791); 1 Jul 2010 08:13:24 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_HF,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Jul 2010 08:13:14 +0000 Received: (qmail 32332 invoked from network); 1 Jul 2010 08:13:12 -0000 Received: from unknown (HELO ?192.168.0.124?) (jie@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Jul 2010 08:13:12 -0000 Message-ID: <4C2C4E0F.8040405@codesourcery.com> Date: Thu, 01 Jul 2010 08:13:00 -0000 From: Jie Zhang User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1 MIME-Version: 1.0 To: Jakub Jelinek CC: Richard Guenther , Alexandre Oliva , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Do framep replacement even on RHS outside of MEM contexts (PR debug/44694) References: <20100629143144.GM25077@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20100629143144.GM25077@tyan-ft48-01.lab.bos.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg00021.txt.bz2 On 06/29/2010 10:31 PM, Jakub Jelinek wrote: > Hi! > > On the ginac.ii testcase cc1plus spends huge amount of time in var-tracking. > The problem is that there are many variables with values sp + const_int > (e.g. this pointers for huge amount of methods) and code to handle > reversible ops results in very long loc_chain lists (up to 3740 entries), > where the sp value is equvalenced with (plus (some_other_value) (const_int N)) > for many different values (and corresponding offsets). > > Fixed by canonicalizing sp (resp. hardfp) to (framep) + offset > even outside of MEM addresses when on the RHS and not doing > reversible ops for framep - which doesn't buy us anything, framep is always > computable using DW_OP_fbreg anywhere in the function. > > The speedup for ginac.ii -g -O2 is from over 3 minutes to 16 seconds. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2010-06-29 Jakub Jelinek > > PR debug/44694 > * cselib.h (cselib_preserve_cfa_base_value): Add regno argument. > * cselib.c (cfa_base_preserved_regno): New static variable. > (cselib_reset_table): Don't reset cfa_base_preserved_regno instead > of REGNO (cfa_base_preserved_val->locs->loc). > (cselib_preserve_cfa_base_value): Add regno argument, set > cfa_base_preserved_regno to it. > (cselib_invalidate_regno): Allow removal of registers other than > cfa_base_preserved_regno from cfa_base_preserved_val. > (cselib_finish): Set cfa_base_preserved_regno to INVALID_REGNUM. > * var-tracking.c (adjust_mems): Replace sp or hfp even outside > of MEM addresses, if not on LHS. > (reverse_op): Don't add reverse ops for cfa_base_rtx. > (vt_init_cfa_base): Adjust cselib_preserve_cfa_base_value caller. > This patch caused ICE for arm-none-eabi target: internal compiler error: in arm_dbx_register_number, at config/arm/arm.c:21155 when compiling thumb multilib libstdc++. > --- gcc/var-tracking.c.jj 2010-06-29 10:33:44.000000000 +0200 > +++ gcc/var-tracking.c 2010-06-29 13:46:07.000000000 +0200 > @@ -798,8 +798,9 @@ adjust_mems (rtx loc, const_rtx old_rtx, > switch (GET_CODE (loc)) > { > case REG: > - /* Don't do any sp or fp replacements outside of MEM addresses. */ > - if (amd->mem_mode == VOIDmode) > + /* Don't do any sp or fp replacements outside of MEM addresses > + on the LHS. */ > + if (amd->mem_mode == VOIDmode&& amd->store) > return loc; > if (loc == stack_pointer_rtx > && !frame_pointer_needed) If I revert this change, the ICE is gone. The ICE occurs when arm_dbx_register_number receives ARG_POINTER_REGNUM but it doesn't handle it since it isn't a hardware register. x86 has no such problem because DBX_REGISTER_NUMBER returns -1 for non hardware register. Regards, -- Jie Zhang CodeSourcery