From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22011 invoked by alias); 8 Apr 2011 13:14:57 -0000 Received: (qmail 21999 invoked by uid 22791); 8 Apr 2011 13:14:56 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,TW_CF,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Apr 2011 13:14:51 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id AF66993A00 for ; Fri, 8 Apr 2011 15:14:50 +0200 (CEST) Date: Fri, 08 Apr 2011 13:14:00 -0000 From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Move MODIFIED_NORETURN_CALLS queueing Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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-04/txt/msg00621.txt.bz2 This moves queueing calls to MODIFIED_NORETURN_CALLS from gimple_set_modified to update_stmt_operands. The former is called when we remove stmts and thus the call may reference freed SSA names which doesn't make gimple_call_noreturn_p happy (and in fact we have a kludge to avoid ICEing here). At the latter point we are sure the stmt is still meaningful, so that's a much better point to queue it. We are also sure we'll call update_stmt eventually on all modified stmts which makes this movement safe as well. Bootstrapped on x86_64-unknown-linux-gnu, regtests in progress. Will commit if that succeeds. Richard. 2011-04-08 Richard Guenther * gimple.c (gimple_set_modified): Do not queue calls to MODIFIED_NORETURN_CALLS here ... * tree-ssa-operands.c (update_stmt_operands): ... but here. Index: gcc/gimple.c =================================================================== *** gcc/gimple.c (revision 172170) --- gcc/gimple.c (working copy) *************** void *** 2252,2266 **** gimple_set_modified (gimple s, bool modifiedp) { if (gimple_has_ops (s)) ! { ! s->gsbase.modified = (unsigned) modifiedp; ! ! if (modifiedp ! && cfun->gimple_df ! && is_gimple_call (s) ! && gimple_call_noreturn_p (s)) ! VEC_safe_push (gimple, gc, MODIFIED_NORETURN_CALLS (cfun), s); ! } } --- 2252,2258 ---- gimple_set_modified (gimple s, bool modifiedp) { if (gimple_has_ops (s)) ! s->gsbase.modified = (unsigned) modifiedp; } Index: gcc/tree-ssa-operands.c =================================================================== *** gcc/tree-ssa-operands.c (revision 172170) --- gcc/tree-ssa-operands.c (working copy) *************** update_stmt_operands (gimple stmt) *** 1134,1139 **** --- 1134,1145 ---- timevar_push (TV_TREE_OPS); + /* If the stmt is a noreturn call queue it to be processed by + split_bbs_on_noreturn_calls during cfg cleanup. */ + if (is_gimple_call (stmt) + && gimple_call_noreturn_p (stmt)) + VEC_safe_push (gimple, gc, MODIFIED_NORETURN_CALLS (cfun), stmt); + gcc_assert (gimple_modified_p (stmt)); build_ssa_operands (stmt); gimple_set_modified (stmt, false);