From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24654 invoked by alias); 3 Aug 2011 10:42:08 -0000 Received: (qmail 24641 invoked by uid 22791); 3 Aug 2011 10:42:08 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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-pz0-f53.google.com (HELO mail-pz0-f53.google.com) (209.85.210.53) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Aug 2011 10:41:52 +0000 Received: by pzk6 with SMTP id 6so1508739pzk.12 for ; Wed, 03 Aug 2011 03:41:51 -0700 (PDT) Received: by 10.142.186.8 with SMTP id j8mr839447wff.208.1312368111647; Wed, 03 Aug 2011 03:41:51 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id y18sm469280wff.20.2011.08.03.03.41.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Aug 2011 03:41:49 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 1F6EA170C264; Wed, 3 Aug 2011 20:11:44 +0930 (CST) Date: Wed, 03 Aug 2011 10:42:00 -0000 From: Alan Modra To: Bernd Schmidt Cc: GCC Patches Subject: Re: [PATCH 4/6] Shrink-wrapping Message-ID: <20110803104143.GI26813@bubble.grove.modra.org> Mail-Followup-To: Bernd Schmidt , GCC Patches References: <4D8A0703.9090306@codesourcery.com> <4D8A095C.8050809@codesourcery.com> <4E2766B8.80904@codesourcery.com> <4E313B82.8050403@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E313B82.8050403@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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-08/txt/msg00290.txt.bz2 On Thu, Jul 28, 2011 at 12:35:46PM +0200, Bernd Schmidt wrote: [snip] > * rtl.h (ANY_RETURN_P): New macro. [snip] This patch makes rebuild_jump_labels set JUMP_LABEL appropriately for return jumps, and fixes sharing for RETURN. Since ANY_RETURN_P(X) is defined as ((X) == ret_rtx), RETURNs need to stay shared. Bootstrapped and regression tested powerpc-linux and powerpc64-linux. OK to apply? PR rtl-optimization/49941 * jump.c (mark_jump_label): Comment. (mark_jump_label_1): Set JUMP_LABEL for return jumps. * emit-rtl.c (copy_rtx_if_shared_1, copy_insn_1): Leave RETURN shared. (mark_used_flags): Don't mark RETURN. Index: gcc/jump.c =================================================================== --- gcc/jump.c (revision 177084) +++ gcc/jump.c (working copy) @@ -1039,6 +1039,7 @@ sets_cc0_p (const_rtx x) notes. If INSN is an INSN or a CALL_INSN or non-target operands of a JUMP_INSN, and there is at least one CODE_LABEL referenced in INSN, add a REG_LABEL_OPERAND note containing that label to INSN. + For returnjumps, the JUMP_LABEL will also be set as appropriate. Note that two labels separated by a loop-beginning note must be kept distinct if we have not yet done loop-optimization, @@ -1081,6 +1082,14 @@ mark_jump_label_1 (rtx x, rtx insn, bool case CALL: return; + case RETURN: + if (is_target) + { + gcc_assert (JUMP_LABEL (insn) == NULL || JUMP_LABEL (insn) == x); + JUMP_LABEL (insn) = x; + } + return; + case MEM: in_mem = true; break; Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c (revision 177084) +++ gcc/emit-rtl.c (working copy) @@ -2724,6 +2724,7 @@ repeat: case CODE_LABEL: case PC: case CC0: + case RETURN: case SCRATCH: /* SCRATCH must be shared because they represent distinct values. */ return; @@ -2843,6 +2844,7 @@ repeat: case CODE_LABEL: case PC: case CC0: + case RETURN: return; case DEBUG_INSN: @@ -5257,6 +5259,7 @@ copy_insn_1 (rtx orig) case CODE_LABEL: case PC: case CC0: + case RETURN: return orig; case CLOBBER: if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER) -- Alan Modra Australia Development Lab, IBM