From patchwork Thu Apr 5 12:37:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 150947 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 204C4B7055 for ; Thu, 5 Apr 2012 22:38:00 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334234281; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=VY7pr4JSdThxFurz2esvJT0Ho94=; b=qkSlNIxXjBIZkYf PRp+hTfEuuJt5IDY2Vv+F4ldrIFT4zB4di5sBjBrFEtOWQ/JjWvBkt2A/cGu5fKD k1WFACB8/OnpffACljFOeCQp+KuHRa+3knfqj/mTg6mqRjYQn4BRzRhrRwnqmksu /xWriNIK5xYTDlhAQqadrcRKgJWg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=vvr3hrAditdyqMk0BwYG4Jo8DP3nBVcgpiDLWlzo7A+uqwoxA8G+VbdaTjWUY2 gKWO80JduRXXXCL9fuj3t+MdX5Iwygdnfy7LLg1IvZyErJeJW6XrgmbvpoOtRoED WdBwDadM1uj60mJQgC/qXP76JupAsDhhjasWyzARdbZ2c=; Received: (qmail 18763 invoked by alias); 5 Apr 2012 12:37:56 -0000 Received: (qmail 18587 invoked by uid 22791); 5 Apr 2012 12:37:55 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 12:37:41 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 067C8A0BB3; Thu, 5 Apr 2012 14:37:40 +0200 (CEST) Date: Thu, 5 Apr 2012 14:37:39 +0200 (CEST) From: Richard Guenther To: Rainer Orth Cc: Richard Guenther , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Make gsi_remove return whether EH cleanup is required In-Reply-To: Message-ID: References: MIME-Version: 1.0 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 Thu, 5 Apr 2012, Rainer Orth wrote: > Richard Guenther writes: > > > On Thu, Apr 5, 2012 at 1:20 PM, Rainer Orth wrote: > >> Richard Guenther writes: > >> > >>> Several passes needlessly cleanup EH after gsi_remove because they do > >>> not know whether the stmt was removed from EH regions.  The following > >>> patch returns this information from gsi_remove and adjusts all users > >>> I could find appropriately. > >> > >> I suspect this patch caused a go1 SEGV compiling the non-PIC > >> libgo/exp/norm.o on i386-pc-solaris2.10: > > > > Ah. Try > > > > Index: gcc/tree-ssa-dse.c > > =================================================================== > > --- gcc/tree-ssa-dse.c (revision 186161) > > +++ gcc/tree-ssa-dse.c (working copy) > > @@ -232,6 +232,8 @@ dse_optimize_stmt (gimple_stmt_iterator > > gimple_get_lhs (use_stmt), 0))) > > || stmt_kills_ref_p (use_stmt, gimple_assign_lhs (stmt))) > > { > > + basic_block bb; > > + > > /* If use_stmt is or might be a nop assignment, e.g. for > > struct { ... } S a, b, *p; ... > > b = a; b = b; > > @@ -258,8 +260,9 @@ dse_optimize_stmt (gimple_stmt_iterator > > unlink_stmt_vdef (stmt); > > > > /* Remove the dead store. */ > > + bb = gimple_bb (stmt); > > if (gsi_remove (&gsi, true)) > > - bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index); > > + bitmap_set_bit (need_eh_cleanup, bb->index); > > > > /* And release any SSA_NAMEs set in this statement back to the > > SSA_NAME manager. */ > > > > Works fine on x86_64-unknown-linux-gnu, where the failure happened as > well. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2012-04-05 Richard Guenther * tree-ssa-dse.c (dse_optimize_stmt): Remember the stmt basic-block before removing it. Index: gcc/tree-ssa-dse.c =================================================================== --- gcc/tree-ssa-dse.c (revision 186161) +++ gcc/tree-ssa-dse.c (working copy) @@ -232,6 +232,8 @@ dse_optimize_stmt (gimple_stmt_iterator gimple_get_lhs (use_stmt), 0))) || stmt_kills_ref_p (use_stmt, gimple_assign_lhs (stmt))) { + basic_block bb; + /* If use_stmt is or might be a nop assignment, e.g. for struct { ... } S a, b, *p; ... b = a; b = b; @@ -258,8 +260,9 @@ dse_optimize_stmt (gimple_stmt_iterator unlink_stmt_vdef (stmt); /* Remove the dead store. */ + bb = gimple_bb (stmt); if (gsi_remove (&gsi, true)) - bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index); + bitmap_set_bit (need_eh_cleanup, bb->index); /* And release any SSA_NAMEs set in this statement back to the SSA_NAME manager. */