From patchwork Mon Jul 29 20:24:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 263002 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 57DA02C0100 for ; Tue, 30 Jul 2013 06:24:22 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:to:cc:subject:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=flZ/Q7OLupzwIZki 9JiSd5za+DiT/R855mNy2ss37JjTlHPy78EnbWe0fTljlAscBRYU1zVFFg7eGOOY I0pUCEvfD+YR8f8fJvyxfK9aZ4/9gj82q4LuAAwKbaw7wCMoOLqc9PnstQwFilVA bmSBEYiq1GkfOBglJhGoAcRSDJY= 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 :message-id:date:from:to:cc:subject:mime-version:content-type :content-transfer-encoding; s=default; bh=Jyfn2oqEQ0ePkOAJeVfuil S5Q5k=; b=ttNqYZ2FBEbbZg233m3aM5x+OznZQjrl1/aoG/cbkpmzMVbCrLj3V7 sL/bmmywfVpUIKpJFN+DInheT0Gq7vkNk1GuhNHKpQtsIZM4MIv8xi4vucleszW3 QhhP+yjoeyElNikZeS+ZDuwzJ6ndP4d17enKKwuMLxcQR8GripLjM= Received: (qmail 16121 invoked by alias); 29 Jul 2013 20:24:15 -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 16112 invoked by uid 89); 29 Jul 2013 20:24:14 -0000 X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_50, KHOP_RCVD_UNTRUST, MIME_QP_LONG_LINE, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_W, RDNS_NONE autolearn=ham version=3.3.1 Received: from Unknown (HELO c62.cesmail.net) (216.154.195.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Jul 2013 20:24:13 +0000 Received: from unknown (HELO epsilon2) ([192.168.1.60]) by c62.cesmail.net with ESMTP; 29 Jul 2013 16:24:06 -0400 Received: from cust213-dsl91-135-11.idnet.net (cust213-dsl91-135-11.idnet.net [91.135.11.213]) by webmail.spamcop.net (Horde MIME library) with HTTP; Mon, 29 Jul 2013 16:24:06 -0400 Message-ID: <20130729162406.tunrdei084808gw8-nzlynne@webmail.spamcop.net> Date: Mon, 29 Jul 2013 16:24:06 -0400 From: Joern Rennecke To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: RFA: Fix rtl-optimization/58021 MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) X-Virus-Found: No The interesting case where we encounter a basic block head is when the check of return_copy for BB_HEAD check succeeds with return_copy being a label; then last_insn is a NOTE_INSN_BASIC_BLOCK, and we must not try to split off a part of the basic block before that note. That can be properly tested for by changing the !INSN_P (last_insn) check into a NOTE_INSN_BASIC_BLOCK_P (last_insn) check. last_insn == BB_HEAD (src_bb) can't actually be true, because we don't copy return_copy to last_insn when we've bit BB_HEAD, so I removed that test. bootstrapped / regtested on i686-pc-linux-gnu . AFAICT, the second block split is useless, and could be replaced with pre_exit = src_bb; , and then the slack space allocated for post_entry / pre_exit blocks reduced to two. However, I didn't want to tie a bugfix with a potentialy destabilizing cleanup - maybe there's some target port code (in the context of likely spilled classes?) that relies on the MODE_EXIT switch note only before, but in a block separate from the return value copy? 2013-07-29 Joern Rennecke PR rtl-optimization/58021 * mode-switching.c (create_pre_exit): Always split of preceding insns if we are not at the basic block head. Index: mode-switching.c =================================================================== --- mode-switching.c (revision 201313) +++ mode-switching.c (working copy) @@ -420,7 +420,7 @@ create_pre_exit (int n_entities, int *en || (GET_MODE_CLASS (GET_MODE (ret_reg)) != MODE_INT && nregs != 1)); - if (INSN_P (last_insn)) + if (!NOTE_INSN_BASIC_BLOCK_P (last_insn)) { before_return_copy = emit_note_before (NOTE_INSN_DELETED, last_insn); @@ -428,9 +428,8 @@ create_pre_exit (int n_entities, int *en require a different mode than MODE_EXIT, so if we might have such instructions, keep them in a separate block from pre_exit. */ - if (last_insn != BB_HEAD (src_bb)) - src_bb = split_block (src_bb, - PREV_INSN (before_return_copy))->dest; + src_bb = split_block (src_bb, + PREV_INSN (before_return_copy))->dest; } else before_return_copy = last_insn;