From patchwork Mon Apr 2 14:56:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Belevantsev X-Patchwork-Id: 150172 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 59F95B6EEC for ; Tue, 3 Apr 2012 00:56:47 +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=1333983408; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=jz1w4BNDswLQGev509ZE G4KH20U=; b=Z6ZTLP+TVPVcPAVUhcr3OJzoS6h4w1NxSQZ+Ab41B0gCMAaIp1e1 cN6fLvA8/uaFBvOboZAodzOWv2Rh25MfUxI3dFR7eds4o6U0beKcs9vZaiGnE8hs WPt8YT0m6W7LlkPzcvAiAdDsPiRS7mlU8YhaHV4v4a/GbNyc3Gf9baE= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VZspoA44wYrMLxzohTsUp6FxzHoSOZ6ZGxTWHr+iO3ztZxNhMdn0zRvU4hjCsy FVk0pjoSvERPgoHyEdxlSLVnLvGXebjUcz9voFDAXdZpTcUYeixdoakPt39PDe79 NpcDGdWVGeKScuWlZIZ0NooXXatxjTMWEfdi0jzpteUwI=; Received: (qmail 3521 invoked by alias); 2 Apr 2012 14:56:40 -0000 Received: (qmail 3512 invoked by uid 22791); 2 Apr 2012 14:56:38 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, TW_CF, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.ispras.ru (HELO mail.ispras.ru) (83.149.199.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Apr 2012 14:56:25 +0000 Received: from [10.10.3.52] (winnie.ispras.ru [83.149.198.236]) by mail.ispras.ru (Postfix) with ESMTP id CAEF424FE56; Mon, 2 Apr 2012 18:56:23 +0400 (MSK) Message-ID: <4F79BE19.8050905@ispras.ru> Date: Mon, 02 Apr 2012 18:56:25 +0400 From: Andrey Belevantsev User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120321 Thunderbird/12.0 MIME-Version: 1.0 To: Jakub Jelinek CC: GCC Patches Subject: Re: [PATCH, RTL] Fix PR 51106 References: <4F182526.6060604@ispras.ru> <20120119144031.GV18768@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20120119144031.GV18768@tyan-ft48-01.lab.bos.redhat.com> 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 Hello, On 19.01.2012 18:40, Jakub Jelinek wrote: > On Thu, Jan 19, 2012 at 06:13:58PM +0400, Andrey Belevantsev wrote: >> 2012-01-19 Andrey Belevantsev >> >> PR target/51106 >> * function.c (instantiate_virtual_regs_in_insn): Use >> delete_insn_and_edges when removing a wrong asm insn. > > This is ok for trunk. > After Richi's RTL generation related cleanups went it, the extra cleanup_cfg call was added so we are no longer lucky to have the proper fallthru edge in this case. The PR trail has the patch to purge_dead_edges making it consider this situation, but I still prefer the below patch that fixes only the invalid asm case. The reason is that I think it unlikely that after initial RTL expansion (of which the instantiate virtual regs pass seems to be the part) we will get the problematic situation. However, I'm happy to test the PR trail patch, too. Tested fine on x86-64, ok for trunk? Andrey 2012-04-02 Andrey Belevantsev PR target/51106 PR middle-end/52650 * function.c (instantiate_virtual_regs_in_insn): Make sure to set the proper fallthru bits when removing a wrong jump asm. diff --git a/gcc/function.c b/gcc/function.c index 3e903ef..a2638bb 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1730,6 +1730,15 @@ instantiate_virtual_regs_in_insn (rtx insn) if (!check_asm_operands (PATTERN (insn))) { error_for_asm (insn, "impossible constraint in %"); + if (JUMP_P (insn)) + { + basic_block bb = BLOCK_FOR_INSN (insn); + edge e; + + if (single_succ_p (bb) + && !((e = single_succ_edge (bb))->flags & EDGE_FALLTHRU)) + e->flags |= EDGE_FALLTHRU; + } delete_insn_and_edges (insn); } }