From patchwork Fri Dec 23 21:09:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 133142 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 639D2B702C for ; Sat, 24 Dec 2011 08:10:31 +1100 (EST) Received: (qmail 25067 invoked by alias); 23 Dec 2011 21:10:28 -0000 Received: (qmail 25051 invoked by uid 22791); 23 Dec 2011 21:10:26 -0000 X-SWARE-Spam-Status: No, hits=-7.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, 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; Fri, 23 Dec 2011 21:10:08 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBNLA8cq025467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Dec 2011 16:10:08 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pBNLA7v3018630 for ; Fri, 23 Dec 2011 16:10:08 -0500 Received: from localhost.localdomain (ovpn-113-35.phx2.redhat.com [10.3.113.35]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pBNLA6H4001926 for ; Fri, 23 Dec 2011 16:10:07 -0500 Message-ID: <4EF4EDF6.7050907@redhat.com> Date: Fri, 23 Dec 2011 16:09:10 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [lra] patch to fix an arm testsuite degradation 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 a degradation of 20060102-1.c on ARM. Not updating REG notes resulted in removing an insn after LRA as it was wrongly considered dead. The patch was successfully bootstrapped on x86/x86-64. Committed as rev. 182664. 2011-12-23 Vladimir Makarov * lra.c (update_auto_inc_notes): Rename to update_reg_notes. Make it unconditional. Remove REG_DEAD and REG_UNUSED too. Make call of add_auto_inc_notes conditional. Index: lra.c =================================================================== --- lra.c (revision 182663) +++ lra.c (working copy) @@ -2032,10 +2032,14 @@ add_auto_inc_notes (rtx insn, rtx x) } } -/* DF infrastructure does not deal with REG_INC notes -- so update - them here. */ +#endif + +/* Remove all REG_DEAD and REG_UNUSED notes and regenerate REG_INC. + We change pseudos by hard registers without notification of DF and + that can make the notes obsolete. DF-infrastructure does not deal + with REG_INC notes -- so we should regenerate them here. */ static void -update_auto_inc_notes (void) +update_reg_notes (void) { rtx *pnote; basic_block bb; @@ -2048,17 +2052,19 @@ update_auto_inc_notes (void) pnote = ®_NOTES (insn); while (*pnote != 0) { - if (REG_NOTE_KIND (*pnote) == REG_INC) + if (REG_NOTE_KIND (*pnote) == REG_DEAD + || REG_NOTE_KIND (*pnote) == REG_UNUSED + || REG_NOTE_KIND (*pnote) == REG_INC) *pnote = XEXP (*pnote, 1); else pnote = &XEXP (*pnote, 1); } +#ifdef AUTO_INC_DEC add_auto_inc_notes (insn, PATTERN (insn)); +#endif } } -#endif - /* Set to 1 while in lra. */ int lra_in_progress; @@ -2204,9 +2210,7 @@ lra (FILE *f) regstat_free_n_sets_and_refs (); regstat_free_ri (); reload_completed = 1; -#ifdef AUTO_INC_DEC - update_auto_inc_notes (); -#endif + update_reg_notes (); finish_subregs_of_mode (); inserted_p = fixup_abnormal_edges ();