From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22401 invoked by alias); 5 Apr 2011 19:32:17 -0000 Received: (qmail 22390 invoked by uid 22791); 5 Apr 2011 19:32:16 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Apr 2011 19:32:12 +0000 Received: by wye20 with SMTP id 20so735690wye.20 for ; Tue, 05 Apr 2011 12:32:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.221.14 with SMTP id q14mr5584023wep.49.1302031931167; Tue, 05 Apr 2011 12:32:11 -0700 (PDT) Received: by 10.216.50.66 with HTTP; Tue, 5 Apr 2011 12:32:11 -0700 (PDT) In-Reply-To: <20110405182820.GC27880@nightcrawler> References: <20110404184952.GA5423@nightcrawler> <20110405135941.GA27880@nightcrawler> <20110405182255.GK23480@codesourcery.com> <20110405182820.GC27880@nightcrawler> Date: Tue, 05 Apr 2011 19:32:00 -0000 Message-ID: Subject: Re: [PATCH] allocate combine.c:LOG_LINKS in an obstack From: "H.J. Lu" To: Nathan Froyd Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-04/txt/msg00395.txt.bz2 On Tue, Apr 5, 2011 at 11:28 AM, Nathan Froyd wr= ote: > On Tue, Apr 05, 2011 at 11:22:56AM -0700, Nathan Froyd wrote: >> On Tue, Apr 05, 2011 at 09:59:43AM -0400, Nathan Froyd wrote: >> > On Mon, Apr 04, 2011 at 02:49:54PM -0400, Nathan Froyd wrote: >> > > This patch does just what $SUBJECT suggests. >> > >> > v2, now with obstacks! >> >> This broke compilation on AUTO_INC_DEC targets. =A0Currently putting >> together a fix and testing via cross to powerpc-eabispe. > > ...and here's the patch I'm going to install. > > -Nathan > > =A0 =A0 =A0 =A0* combine.c (combine_instructions) [AUTO_INC_DEC]: Declare= links > =A0 =A0 =A0 =A0as an rtx. > =A0 =A0 =A0 =A0(try_combine) [AUTO_INC_DEC]: Declare a local link rtx. > > diff --git a/gcc/combine.c b/gcc/combine.c > index 30b7fdd..3e4a38c 100644 > --- a/gcc/combine.c > +++ b/gcc/combine.c > @@ -1139,6 +1139,8 @@ combine_instructions (rtx f, unsigned int nregs) > =A0 =A0 =A0 FOR_BB_INSNS (this_basic_block, insn) > =A0 =A0 =A0 =A0 if (INSN_P (insn) && BLOCK_FOR_INSN (insn)) > =A0 =A0 =A0 =A0 =A0{ > + =A0 =A0 =A0 =A0 =A0 =A0rtx links; ^^^^^^^^^^^^^^^^^^^^^^ links may be unused if AUTO_INC_DEC is not defined. > + > =A0 =A0 =A0 =A0 =A0 =A0 subst_low_luid =3D DF_INSN_LUID (insn); > =A0 =A0 =A0 =A0 =A0 =A0 subst_insn =3D insn; > > @@ -2911,15 +2913,18 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int = *new_direct_jump_p) > =A0 =A0 /* It's not the exception. =A0*/ > =A0#endif > =A0#ifdef AUTO_INC_DEC > - =A0 =A0for (link =3D REG_NOTES (i3); link; link =3D XEXP (link, 1)) > - =A0 =A0 =A0if (REG_NOTE_KIND (link) =3D=3D REG_INC > - =A0 =A0 =A0 =A0 && (reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (i= 2)) > - =A0 =A0 =A0 =A0 =A0 =A0 || (i1 !=3D 0 > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && reg_overlap_mentioned_p (XEXP (link,= 0), PATTERN (i1))))) > - =A0 =A0 =A0 { > - =A0 =A0 =A0 =A0 undo_all (); > - =A0 =A0 =A0 =A0 return 0; > - =A0 =A0 =A0 } > + =A0 =A0{ > + =A0 =A0 =A0rtx link; > + =A0 =A0 =A0for (link =3D REG_NOTES (i3); link; link =3D XEXP (link, 1)) > + =A0 =A0 =A0 if (REG_NOTE_KIND (link) =3D=3D REG_INC > + =A0 =A0 =A0 =A0 =A0 && (reg_overlap_mentioned_p (XEXP (link, 0), PATTER= N (i2)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 || (i1 !=3D 0 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && reg_overlap_mentioned_p (XEXP (l= ink, 0), PATTERN (i1))))) > + =A0 =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 =A0 undo_all (); > + =A0 =A0 =A0 =A0 =A0 return 0; > + =A0 =A0 =A0 =A0 } > + =A0 =A0} > =A0#endif > > =A0 /* See if the SETs in I1 or I2 need to be kept around in the merged > --=20 H.J.