From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32060 invoked by alias); 16 Aug 2011 15:25:06 -0000 Received: (qmail 32032 invoked by uid 22791); 16 Aug 2011 15:25:04 -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-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Aug 2011 15:24:49 +0000 Received: by fxg11 with SMTP id 11so68658fxg.20 for ; Tue, 16 Aug 2011 08:24:48 -0700 (PDT) Received: by 10.223.156.65 with SMTP id v1mr7192303faw.39.1313508288282; Tue, 16 Aug 2011 08:24:48 -0700 (PDT) Received: from richards-thinkpad.stglab.manchester.uk.ibm.com (gbibp9ph1--blueice3n2.emea.ibm.com [195.212.29.84]) by mx.google.com with ESMTPS id d1sm95568fai.28.2011.08.16.08.24.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Aug 2011 08:24:47 -0700 (PDT) From: Richard Sandiford To: Ramana Radhakrishnan Mail-Followup-To: Ramana Radhakrishnan ,gcc@gcc.gnu.org, richard.sandiford@linaro.org Cc: gcc@gcc.gnu.org Subject: Re: regrename and odd behaviour with early clobber operands References: Date: Tue, 16 Aug 2011 15:25:00 -0000 In-Reply-To: (Ramana Radhakrishnan's message of "Tue, 16 Aug 2011 07:40:22 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00294.txt.bz2 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. > > `and earlier > chains they would overlap with must have been closed at > the previous insn at the latest, as such operands cannot > possibly overlap with any input operands. */' Just to summarise on-list what we talked about on IRC: this is supposed to happen through REG_DEAD notes. The bug in this case appears to be that the required note is missing. The patch below seems to fix things. If it's right, I'm very surprised we hadn't noticed until now. There must be something else going on... Richard Index: gcc/df-problems.c =================================================================== --- gcc/df-problems.c 2011-07-11 12:21:33.000000000 +0100 +++ gcc/df-problems.c 2011-08-16 16:18:52.333237669 +0100 @@ -3376,7 +3376,7 @@ df_note_bb_compute (unsigned int bb_inde while (*mws_rec) { struct df_mw_hardreg *mws = *mws_rec; - if ((DF_MWS_REG_DEF_P (mws)) + if ((DF_MWS_REG_USE_P (mws)) && !df_ignore_stack_reg (mws->start_regno)) { bool really_add_notes = debug_insn != 0;