From patchwork Tue Oct 23 02:42:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 193320 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 631002C0180 for ; Tue, 23 Oct 2012 13:43:14 +1100 (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=1351564995; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=rizAxeO 5/675L9+cguiqO33KLY4=; b=kBgozjuulWhuVcRmH2H7gtQ1dh9W2XJlJTtorpj FGPllKM95BpfEOxtWhVwJjlS0RtgOGMvS5lFeQudvk6RbBfh/Nj2DJKwKhlS8cUy YajJC6IQM+4N/qIT5PKTH6rmHM8oD9gLIBnu7xK+ZkosF7MjJKKKWnsM26WbmlcX xqyw= 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:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ndeBeqGHxBLVamGYKkOmiRDJg0cuecXRXSOu7EiNjZGH0X6hEBo/D/NwJIIoVJ ABKu0gHhxPf1eoobs1VX3M66zyIVZ3KiGgu079NMvU7XpBNXhDg/93g6XWdI4mqF a9XDeWTWF7NvoqBh4fjV0qrSDf5HUFkOuupn2/m/XM//0=; Received: (qmail 14385 invoked by alias); 23 Oct 2012 02:43:06 -0000 Received: (qmail 14287 invoked by uid 22791); 23 Oct 2012 02:43:04 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Oct 2012 02:42:56 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9N2gt9p031570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Oct 2012 22:42:55 -0400 Received: from Mair.local (vpn-8-90.rdu.redhat.com [10.11.8.90]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9N2gsEc006681 for ; Mon, 22 Oct 2012 22:42:55 -0400 Message-ID: <5086042E.2050308@redhat.com> Date: Mon, 22 Oct 2012 22:42:54 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: GCC Patches Subject: [lra] patch to fix several testsuite failures 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 The following patch fixes several new testsuite failures. Committed as rev. 192657. 2012-10-22 Vladimir Makarov * inherit_reload_reg (inherit_reload_reg): Print bb numbers too. (need_for_split_p): Don't split eliminable registers. (fix_bb_live_info): Don't use EXECUTE_IF_AND_IN_BITMAP. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 192689) +++ lra-constraints.c (working copy) @@ -3939,8 +3939,8 @@ inherit_reload_reg (bool def_p, int orig /* We now have a new usage insn for original regno. */ setup_next_usage_insn (original_regno, new_insns, reloads_num, false); if (lra_dump_file != NULL) - fprintf (lra_dump_file, " Original reg change %d->%d:\n", - original_regno, REGNO (new_reg)); + fprintf (lra_dump_file, " Original reg change %d->%d (bb%d):\n", + original_regno, REGNO (new_reg), BLOCK_FOR_INSN (insn)->index); lra_reg_info[REGNO (new_reg)].restore_regno = original_regno; bitmap_set_bit (&check_only_regs, REGNO (new_reg)); bitmap_set_bit (&check_only_regs, original_regno); @@ -3969,8 +3969,10 @@ inherit_reload_reg (bool def_p, int orig lra_update_insn_regno_info (usage_insn); if (lra_dump_file != NULL) { - fprintf (lra_dump_file, " Inheritance reuse change %d->%d:\n", - original_regno, REGNO (new_reg)); + fprintf (lra_dump_file, + " Inheritance reuse change %d->%d (bb%d):\n", + original_regno, REGNO (new_reg), + BLOCK_FOR_INSN (usage_insn)->index); debug_rtl_slim (lra_dump_file, usage_insn, usage_insn, -1, 0); } @@ -4015,6 +4017,13 @@ need_for_split_p (HARD_REG_SET potential lra_assert (hard_regno >= 0); return ((TEST_HARD_REG_BIT (potential_reload_hard_regs, hard_regno) + /* Don't split eliminable hard registers, otherwise we can + split hard registers like hard frame pointer, which + lives on BB start/end according to DF-infrastructure, + when there is a pseudo assigned to the register and + living in the same BB. */ + && (regno >= FIRST_PSEUDO_REGISTER + || ! TEST_HARD_REG_BIT (eliminable_regset, hard_regno)) && ! TEST_HARD_REG_BIT (lra_no_alloc_regs, hard_regno) /* We need at least 2 reloads to make pseudo splitting profitable. We should provide hard regno splitting in @@ -4284,7 +4293,7 @@ update_ebb_live_info (rtx head, rtx tail edge e; edge_iterator ei; - last_bb = BLOCK_FOR_INSN (tail); + last_bb = BLOCK_FOR_INSN (tail); prev_bb = NULL; for (curr_insn = tail; curr_insn != PREV_INSN (head); @@ -4492,7 +4501,7 @@ inherit_in_ebb (rtx head, rtx tail) after_p = (! JUMP_P (last_insn) && (! CALL_P (last_insn) || (find_reg_note (last_insn, - REG_NORETURN, NULL) == NULL_RTX + REG_NORETURN, NULL_RTX) == NULL_RTX && ! SIBLING_CALL_P (last_insn)))); REG_SET_TO_HARD_REG_SET (live_hard_regs, df_get_live_out (curr_bb)); IOR_HARD_REG_SET (live_hard_regs, eliminable_regset); @@ -4800,7 +4809,6 @@ lra_inheritance (void) edge e; timevar_push (TV_LRA_INHERITANCE); - lra_inheritance_iter++; if (lra_dump_file != NULL) fprintf (lra_dump_file, "\n********** Inheritance #%d: **********\n\n", @@ -4867,11 +4875,9 @@ fix_bb_live_info (bitmap live, bitmap re unsigned int regno; bitmap_iterator bi; - EXECUTE_IF_AND_IN_BITMAP (removed_pseudos, live, 0, regno, bi) - { - bitmap_clear_bit (live, regno); + EXECUTE_IF_SET_IN_BITMAP (removed_pseudos, 0, regno, bi) + if (bitmap_clear_bit (live, regno)) bitmap_set_bit (live, lra_reg_info[regno].restore_regno); - } } /* Return regno of the (subreg of) REG. Otherwise, return a negative