From patchwork Thu Jul 7 19:29:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 103725 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 11441B6F74 for ; Fri, 8 Jul 2011 05:29:23 +1000 (EST) Received: (qmail 9885 invoked by alias); 7 Jul 2011 19:29:22 -0000 Received: (qmail 9876 invoked by uid 22791); 7 Jul 2011 19:29:21 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, 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; Thu, 07 Jul 2011 19:29:03 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p67JT2AJ014302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jul 2011 15:29:02 -0400 Received: from toll.yyz.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p67JT1ca005291 for ; Thu, 7 Jul 2011 15:29:02 -0400 Message-ID: <4E1608FD.2000608@redhat.com> Date: Thu, 07 Jul 2011 15:29:01 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches Subject: [lra] patch to fix GCC testsuite degradations on x86 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 all current GCC testsuite degradations of IRA+LRA in comparison with IRA + reload on x86 bringing IRA+LRA having less testsuite failures on x86 than IRA+reload. The patch was successfully bootstrapped on x86-64, IA64, and ppc64. 2011-07-07 Vladimir Makarov * lra-int.h (lra_invalidate_insn_data): New prototype. * lra.c (lra_invalidate_insn_data): Split out from ... (lra_set_insn_deleted): ... here. * lra-constraints.c (curr_insn_transform): Call lra_invalidate_insn_data and return true for wrong asm insn. (lra_constraints): Use dest_reg instead of SET_DEST (set). Index: lra-int.h =================================================================== --- lra-int.h (revision 175931) +++ lra-int.h (working copy) @@ -252,6 +252,7 @@ extern void lra_push_insn_and_update_ins extern rtx lra_create_new_reg (enum machine_mode, rtx, enum reg_class, const char *); +extern void lra_invalidate_insn_data (rtx); extern void lra_set_insn_deleted (rtx); extern void lra_delete_dead_insn (rtx); extern void lra_emit_add (rtx, rtx, rtx); Index: lra.c =================================================================== --- lra.c (revision 175931) +++ lra.c (working copy) @@ -107,13 +107,20 @@ lra_create_new_reg (enum machine_mode md return new_reg; } +/* Invalidate INSN related info used by LRA. */ +void +lra_invalidate_insn_data (rtx insn) +{ + lra_invalidate_insn_regno_info (insn); + invalidate_insn_recog_data (INSN_UID (insn)); +} + /* Mark INSN deleted and invalidate the insn related info used by LRA. */ void lra_set_insn_deleted (rtx insn) { - lra_invalidate_insn_regno_info (insn); - invalidate_insn_recog_data (INSN_UID (insn)); + lra_invalidate_insn_data (insn); SET_INSN_DELETED (insn); } Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 175931) +++ lra-constraints.c (working copy) @@ -2760,7 +2760,8 @@ curr_insn_transform (void) "inconsistent operand constraints in an %"); /* Avoid further trouble with this insn. */ PATTERN (curr_insn) = gen_rtx_USE (VOIDmode, const0_rtx); - return false; + lra_invalidate_insn_data (curr_insn); + return true; } /* If the best alternative is with operands 1 and 2 swapped, swap @@ -3273,7 +3274,7 @@ lra_constraints (bool first_p) && (! MEM_P (x) || MEM_READONLY_P (x) || in_list_p (curr_insn, ira_reg_equiv - [REGNO (SET_DEST (set))].init_insns))) + [REGNO (dest_reg)].init_insns))) || (SET_SRC (set) != get_equiv_substitution (SET_SRC (set)) && in_list_p (curr_insn, ira_reg_equiv