From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19954 invoked by alias); 4 Dec 2001 18:06:05 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 19931 invoked from network); 4 Dec 2001 18:06:04 -0000 Received: from unknown (HELO taltos.codesourcery.com) (66.92.14.122) by sources.redhat.com with SMTP; 4 Dec 2001 18:06:04 -0000 Received: from zack by taltos.codesourcery.com with local (Exim 3.33 #1 (Debian)) id 16BJxC-0005al-00; Tue, 04 Dec 2001 10:06:02 -0800 Date: Tue, 04 Dec 2001 10:06:00 -0000 From: Zack Weinberg To: Richard Henderson , gcc@gcc.gnu.org Subject: Re: messy combine problem - PPC Message-ID: <20011204180602.GC19450@codesourcery.com> References: <20011203204934.GG292@codesourcery.com> <20011203150606.D7284@redhat.com> <20011203235312.GK292@codesourcery.com> <20011203182706.B7420@redhat.com> <20011204063431.GB18650@codesourcery.com> <20011204093058.B7748@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011204093058.B7748@redhat.com> User-Agent: Mutt/1.3.24i X-SW-Source: 2001-12/txt/msg00137.txt.bz2 On Tue, Dec 04, 2001 at 09:30:58AM -0800, Richard Henderson wrote: > On Mon, Dec 03, 2001 at 10:34:31PM -0800, Zack Weinberg wrote: > > or is there something else that takes care of that? > > Yes, that call_used_regs killing loop in record_dead_and_set_regs. I get it now, thanks for clarifying. I'm testing this patch. zw * combine.c (record_dead_and_set_regs): Use regs_invalidated_by_call. Do not call note_stores for CALL_INSNs. =================================================================== Index: combine.c --- combine.c 2001/11/11 11:25:14 1.241 +++ combine.c 2001/12/04 18:05:50 @@ -11178,7 +11178,7 @@ record_dead_and_set_regs (insn) if (GET_CODE (insn) == CALL_INSN) { for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (call_used_regs[i]) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) { reg_last_set_value[i] = 0; reg_last_set_mode[i] = 0; @@ -11188,6 +11188,13 @@ record_dead_and_set_regs (insn) } last_call_cuid = mem_last_set = INSN_CUID (insn); + + /* Don't bother recording what this insn does. It might set the + return value register, but we can't combine into a call + pattern anyway, so there's no point trying (and it may cause + a crash, if e.g. we wind up asking for last_set_value of a + SUBREG of the return value register). */ + return; } note_stores (PATTERN (insn), record_dead_and_set_regs_1, insn);