From patchwork Tue Sep 22 20:55:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 521435 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 61729140187 for ; Wed, 23 Sep 2015 06:55:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=YLgTTtNH; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=mKfnxeX45+tQMvWs0 u7IlZdXpyecR0MHnnVUSSV/xiF3MncGo75SMTbTSyeVVEgTN0HUZwb1wBzaYG2sl gb7+m/CdHkC70NlLi85MK4KOtTuF8vkEOcHQvpHpunt1Ih96PZeeDsAwVtRnXU8c 1pXdc6MtpcDWyExZZkcagdzGn4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=jTWqopblH3Ux9fuKOlePvhi SNsc=; b=YLgTTtNHro8ruWHtIuU6d9+CB89ScCmUmMnubwNPwu47vCDe0JtYUgy PTkxr1njjbA/dpW0w3HvLc2QQ5oDq/Y5BiuStiaK3gNXs/mQuzG1A0SGzn+oNwyG +5J7xqlMHmyWaoFhq1QSGP2xFvXriaTj9e75IAdTdTGXJxApYRAQ= Received: (qmail 95269 invoked by alias); 22 Sep 2015 20:55:41 -0000 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 Received: (qmail 95251 invoked by uid 89); 22 Sep 2015 20:55:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 22 Sep 2015 20:55:39 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id t8MKtZ5h029238; Tue, 22 Sep 2015 15:55:35 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t8MKtZvt029237; Tue, 22 Sep 2015 15:55:35 -0500 Date: Tue, 22 Sep 2015 15:55:35 -0500 From: Segher Boessenkool To: Bernd Schmidt Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] shrink-wrap: Handle multiple predecessors of prologue Message-ID: <20150922205535.GC3544@gate.crashing.org> References: <52f14532eb742ac8d878a185a46a88da7b0326eb.1442588483.git.segher@kernel.crashing.org> <55FFF06C.7090002@redhat.com> <20150921140159.GA18270@gate.crashing.org> <5601780D.9000600@redhat.com> <20150922161146.GB3544@gate.crashing.org> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150922161146.GB3544@gate.crashing.org> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes On Tue, Sep 22, 2015 at 11:11:47AM -0500, Segher Boessenkool wrote: > > So, given that your solution seems to work, the patch is ok. > > Thanks! Here is what I will commit after bootstrap+test (the superfluous > assert removed, and the comment for the code quoted above tweaked a bit). I added the following tiny patchlet for a paper bag problem revealed by testing on x86-64. Committed together with the rest. Segher --- gcc/shrink-wrap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c index 94b1228..a99474d 100644 --- a/gcc/shrink-wrap.c +++ b/gcc/shrink-wrap.c @@ -822,6 +822,9 @@ try_shrink_wrapping (edge *entry_edge, bitmap_head *bb_with, den += e->src->frequency; } + if (den == 0) + den = 1; + /* All is okay, so do it. */ crtl->shrink_wrapped = true;