From patchwork Wed Oct 20 10:24:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 68422 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 115BAB70A9 for ; Wed, 20 Oct 2010 21:32:41 +1100 (EST) Received: (qmail 11721 invoked by alias); 20 Oct 2010 10:32:39 -0000 Received: (qmail 11712 invoked by uid 22791); 20 Oct 2010 10:32:38 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_TM X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Oct 2010 10:32:31 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 70B15CB022A; Wed, 20 Oct 2010 12:32:29 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BFIppOCLYv7M; Wed, 20 Oct 2010 12:32:29 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 43D12CB0220; Wed, 20 Oct 2010 12:32:29 +0200 (CEST) From: Eric Botcazou To: Richard Guenther Subject: Re: [patch] Fix ICE with dangling abnormal call edges Date: Wed, 20 Oct 2010 12:24:04 +0200 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org References: <201010172300.11179.ebotcazou@adacore.com> <201010181133.11845.ebotcazou@adacore.com> In-Reply-To: <201010181133.11845.ebotcazou@adacore.com> MIME-Version: 1.0 Message-Id: <201010201224.04225.ebotcazou@adacore.com> 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 > OK, I'll add it and retest, thanks. That worked fine so I've installed it. However, as the attached testcase demonstrates, dangling abnormal call edges may be pre-existing, when local-pure-const discovers that a function is pure. So the attached patch is also needed. OK for mainline after full testing? 2010-10-20 Eric Botcazou * tree-optimize.c (execute_fixup_cfg): Purge dead abnormal call edges if there is a call statement to pure or const function in the block. Index: tree-optimize.c =================================================================== --- tree-optimize.c (revision 165574) +++ tree-optimize.c (working copy) @@ -271,13 +271,16 @@ execute_fixup_cfg (void) int flags = gimple_call_flags (stmt); if (flags & (ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE)) { + if (gimple_purge_dead_abnormal_call_edges (bb)) + todo |= TODO_cleanup_cfg; + if (gimple_in_ssa_p (cfun)) { todo |= TODO_update_ssa | TODO_cleanup_cfg; update_stmt (stmt); } } - + if (flags & ECF_NORETURN && fixup_noreturn_call (stmt)) todo |= TODO_cleanup_cfg;