From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1418 invoked by alias); 18 Aug 2011 08:10:58 -0000 Received: (qmail 1398 invoked by uid 22791); 18 Aug 2011 08:10:56 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Aug 2011 08:10:42 +0000 Received: by iyn15 with SMTP id 15so3836230iyn.34 for ; Thu, 18 Aug 2011 01:10:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.28.132 with SMTP id m4mr1060437ibc.20.1313655041895; Thu, 18 Aug 2011 01:10:41 -0700 (PDT) Received: by 10.231.10.67 with HTTP; Thu, 18 Aug 2011 01:10:41 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Aug 2011 08:10:00 -0000 Message-ID: Subject: Re: regrename and odd behaviour with early clobber operands From: Ramana Radhakrishnan To: Ramana Radhakrishnan , gcc@gcc.gnu.org, richard.sandiford@linaro.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00327.txt.bz2 On 16 August 2011 16:24, Richard Sandiford w= rote: > Ramana Radhakrishnan writes: >> I can't see how it is right to construct essentially 2 chains for the >> same register that have overlapping live ranges without an intervening >> conditional branch and since regrename sort of works inside a bb . >> Ideally the chain for 122 should have been terminated at the end of >> 123 rather than allowing this to remain open and have the use in insn >> 141 available for use in both chains starting at 122 and 140 . What >> I'm not sure is which part of regrename makes sure that this part of >> the comment for Stage 5 is ensured. >> >> =A0 =A0 =A0 =A0 =A0 =A0 `and earlier >> =A0 =A0 =A0 =A0 =A0 =A0chains they would overlap with must have been clo= sed at >> =A0 =A0 =A0 =A0 =A0 =A0the previous insn at the latest, as such operands= cannot >> =A0 =A0 =A0 =A0 =A0 =A0possibly overlap with any input operands. =A0*/' > > Just to summarise on-list what we talked about on IRC: this is supposed > to happen through REG_DEAD notes. =A0The bug in this case appears to be > that the required note is missing. > > The patch below seems to fix things. =A0If it's right, I'm very surprised > we hadn't noticed until now. =A0There must be something else going on... I've been digging a bit yesterday afternoon and reading the code it appears as though if you are to check for multiword-register uses you do need to check the macro DF_MWS_REG_USE_P (mws). I suspect if you don't look at that you really aren't looking at what multiword-registers an instruction really uses. Interestingly your patch managed to survive a bootstrap and testrun on x86 with no regressions. Ramana > > Richard > > > Index: gcc/df-problems.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/df-problems.c =A0 2011-07-11 12:21:33.000000000 +0100 > +++ gcc/df-problems.c =A0 2011-08-16 16:18:52.333237669 +0100 > @@ -3376,7 +3376,7 @@ df_note_bb_compute (unsigned int bb_inde > =A0 =A0 =A0 while (*mws_rec) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0struct df_mw_hardreg *mws =3D *mws_rec; > - =A0 =A0 =A0 =A0 if ((DF_MWS_REG_DEF_P (mws)) > + =A0 =A0 =A0 =A0 if ((DF_MWS_REG_USE_P (mws)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0&& !df_ignore_stack_reg (mws->start_regno)) > =A0 =A0 =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0bool really_add_notes =3D debug_insn !=3D 0; >