From patchwork Fri Jun 8 22:35:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 163870 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 5F1F6B6FBD for ; Sat, 9 Jun 2012 08:36:20 +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=1339799780; 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=ZlXLru7 2zgjALMUhucZ5HdP9u+I=; b=aUrK0umgj2ToArTwt6hT/Gr+8LGHD3RmlPux24T fZk00D+PZIqOe7cME0+l5mVNeF5qf280n9X5fTYv04CXOm8Kun5wAad3It3hEJnT LWhG5FXndrH0HQ6cwmxP7JSrjPR9vgh4hsI2JALfhmxUDpUXZPHb69aeI3k2B5Cw Ddhg= 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=EqJ0K5YDR9mmHS5BVAT7BLXywfxfIFrda0xWKTRqSjDzujGKVqoRB3BhQ/736I gPHkqpYsFrDbVKWxNWTo1GLh2oGpy2lAhsWVk/ZroaSkV+vA5ycEvxZhTn3eVf1n PSguvSMxpLbt1t6/T7Fhum9GK/T/jIuP51mufCLmw4e6k=; Received: (qmail 18100 invoked by alias); 8 Jun 2012 22:36:15 -0000 Received: (qmail 17989 invoked by uid 22791); 8 Jun 2012 22:36:14 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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; Fri, 08 Jun 2012 22:36:00 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q58MZxWl019669 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Jun 2012 18:35:59 -0400 Received: from ivy.local (ovpn-113-75.phx2.redhat.com [10.3.113.75]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q58MZw7D003952 for ; Fri, 8 Jun 2012 18:35:59 -0400 Message-ID: <4FD27E4E.1010901@redhat.com> Date: Fri, 08 Jun 2012 18:35:58 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: GCC Patches Subject: [lra] patch to fix some testsuite regressions on ppc 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 fixing some LRA crashes (when I tried a new heuristics in insn alternative selection) on GCC tests on ppc. The patch was successfully bootstrapped on x86-64 and power7. Committed as rev. 188350. 2012-06-08 Vladimir Makarov * emit-rtl.c (validate_subreg): Don't check offset for LRA and floating point modes. * lra.c (lra): Call lra_hard_reg_substitution after resetting lra_in_progress. * lra-constraints.c (match_reload): Unshare new regs. Index: lra.c =================================================================== --- lra.c (revision 188341) +++ lra.c (working copy) @@ -2217,8 +2217,8 @@ lra (FILE *f) } restore_scratches (); lra_eliminate (true); - lra_hard_reg_substitution (); lra_in_progress = 0; + lra_hard_reg_substitution (); lra_clear_live_ranges (); lra_live_ranges_finish (); lra_contraints_finish (); Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 188341) +++ lra-constraints.c (working copy) @@ -872,9 +872,9 @@ match_reload (signed char out, signed ch = lra_create_new_reg_with_unique_value (outmode, out_rtx, goal_class, ""); if (SCALAR_INT_MODE_P (outmode)) - new_in_reg = gen_lowpart_SUBREG (inmode, new_out_reg); + new_in_reg = gen_lowpart_SUBREG (inmode, reg); else - new_in_reg = gen_rtx_SUBREG (inmode, new_out_reg, 0); + new_in_reg = gen_rtx_SUBREG (inmode, reg, 0); } bitmap_set_bit (&lra_matched_pseudos, REGNO (reg)); bitmap_set_bit (&lra_bound_pseudos, REGNO (reg)); @@ -903,7 +903,7 @@ match_reload (signed char out, signed ch narrow_reload_pseudo_class (in_rtx, goal_class); narrow_reload_pseudo_class (out_rtx, goal_class); push_to_sequence (*before); - lra_emit_move (new_in_reg, in_rtx); + lra_emit_move (copy_rtx (new_in_reg), in_rtx); *before = get_insns (); end_sequence (); for (i = 0; (in = ins[i]) >= 0; i++) @@ -912,7 +912,7 @@ match_reload (signed char out, signed ch if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX) { start_sequence (); - lra_emit_move (out_rtx, new_out_reg); + lra_emit_move (out_rtx, copy_rtx (new_out_reg)); emit_insn (*after); *after = get_insns (); end_sequence (); Index: emit-rtl.c =================================================================== --- emit-rtl.c (revision 188333) +++ emit-rtl.c (working copy) @@ -760,7 +760,8 @@ validate_subreg (enum machine_mode omode of a subword. A subreg does *not* perform arbitrary bit extraction. Given that we've already checked mode/offset alignment, we only have to check subword subregs here. */ - if (osize < UNITS_PER_WORD) + if (osize < UNITS_PER_WORD + && ! (lra_in_progress && (FLOAT_MODE_P (imode) || FLOAT_MODE_P (omode)))) { enum machine_mode wmode = isize > UNITS_PER_WORD ? word_mode : imode; unsigned int low_off = subreg_lowpart_offset (omode, wmode);