From patchwork Mon Nov 14 21:56:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 125617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E948BB71C5 for ; Tue, 15 Nov 2011 08:57:24 +1100 (EST) Received: (qmail 9970 invoked by alias); 14 Nov 2011 21:57:16 -0000 Received: (qmail 9959 invoked by uid 22791); 14 Nov 2011 21:57:14 -0000 X-SWARE-Spam-Status: No, hits=-2.6 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-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Nov 2011 21:56:57 +0000 Received: by yenq7 with SMTP id q7so663484yen.20 for ; Mon, 14 Nov 2011 13:56:56 -0800 (PST) Received: by 10.146.182.3 with SMTP id e3mr3222886yaf.27.1321307816799; Mon, 14 Nov 2011 13:56:56 -0800 (PST) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id l19sm65265383anc.14.2011.11.14.13.56.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Nov 2011 13:56:55 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 4CB86170C2BF; Tue, 15 Nov 2011 08:26:48 +1030 (CST) Date: Tue, 15 Nov 2011 08:26:48 +1030 From: Alan Modra To: Richard Henderson Cc: Hans-Peter Nilsson , bernds@codesourcery.com, hp@axis.com, gcc-patches@gcc.gnu.org Subject: Re: CFG review needed for fix of "PowerPC shrink-wrap support 3 of 3" Message-ID: <20111114215648.GI14325@bubble.grove.modra.org> Mail-Followup-To: Richard Henderson , Hans-Peter Nilsson , bernds@codesourcery.com, hp@axis.com, gcc-patches@gcc.gnu.org References: <201111141410.pAEEA7NZ014534@ignucius.se.axis.com> <4EC15453.5040501@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4EC15453.5040501@redhat.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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, Nov 14, 2011 at 07:48:03AM -1000, Richard Henderson wrote: > On 11/14/2011 04:10 AM, Hans-Peter Nilsson wrote: > > Looks like all we need is a positive review of > > and a > > ChangeLog entry to unbreak three or more targets. > > > > Someone with approval rights: pretty please? > > That patch is ok. Sorry for the bootstrap problems. I believe the cause is my extraction of convert_jumps_to_returns and emit_return_for_exit. The new HAVE_return code misses a single_succ_p test (covered by the bitmap_bit_p (&bb_flags, ...) test in the HAVE_simple_return case). I haven't really looked into what Bernd's fix does. I know this one fixes what I broke.. * function.c (thread_prologue_and_epilogue_insns): Guard emitting return with single_succ_p test. Index: gcc/function.c =================================================================== --- gcc/function.c (revision 181188) +++ gcc/function.c (working copy) @@ -6230,7 +6230,8 @@ thread_prologue_and_epilogue_insns (void && !active_insn_between (BB_HEAD (last_bb), BB_END (last_bb))) convert_jumps_to_returns (last_bb, false, NULL); - if (EDGE_COUNT (exit_fallthru_edge->src->preds) != 0) + if (EDGE_COUNT (last_bb->preds) != 0 + && single_succ_p (last_bb)) { last_bb = emit_return_for_exit (exit_fallthru_edge, false); epilogue_end = returnjump = BB_END (last_bb);