From patchwork Thu Jun 16 14:33:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 100652 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 B8BE0B6FA2 for ; Fri, 17 Jun 2011 00:33:34 +1000 (EST) Received: (qmail 15301 invoked by alias); 16 Jun 2011 14:33:32 -0000 Received: (qmail 15284 invoked by uid 22791); 16 Jun 2011 14:33:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 14:33:10 +0000 Received: (qmail 26802 invoked from network); 16 Jun 2011 14:33:10 -0000 Received: from unknown (HELO ?84.152.178.189?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 16 Jun 2011 14:33:10 -0000 Message-ID: <4DFA141D.7010007@codesourcery.com> Date: Thu, 16 Jun 2011 16:33:01 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: GCC Patches Subject: regrename: don't update REG_DEAD notes 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 We're updating REG_DEAD notes in regrename.c, but it seems this is for historical reasons only. As far as I can tell, every pass that needs such notes recomputes them with df_note_add_problem/df_analyze, and the following patch bootstrapped and tested successfully on i686-linux (some random libmudflap failures mentioned previously), with the following change to ensure it's tested: +++ gcc/config/i386/i386.c (working copy) @@ -5099,6 +5099,9 @@ static const struct default_options ix86 #ifdef INSN_SCHEDULING { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 }, #endif +#ifdef INSN_SCHEDULING + { OPT_LEVELS_2_PLUS, OPT_frename_registers, NULL, 1 }, +#endif Ok? Bernd * regrename.c (do_replace): Don't update notes. Index: gcc/regrename.c =================================================================== --- gcc/regrename.c (revision 174842) +++ gcc/regrename.c (working copy) @@ -432,7 +432,6 @@ do_replace (struct du_head *head, int re { struct du_chain *chain; unsigned int base_regno = head->regno; - bool found_note = false; gcc_assert (! DEBUG_INSN_P (head->first->insn)); @@ -446,46 +445,15 @@ do_replace (struct du_head *head, int re INSN_VAR_LOCATION_LOC (chain->insn) = gen_rtx_UNKNOWN_VAR_LOC (); else { - rtx note; - *chain->loc = gen_raw_REG (GET_MODE (*chain->loc), reg); if (regno >= FIRST_PSEUDO_REGISTER) ORIGINAL_REGNO (*chain->loc) = regno; REG_ATTRS (*chain->loc) = attr; REG_POINTER (*chain->loc) = reg_ptr; - - for (note = REG_NOTES (chain->insn); note; note = XEXP (note, 1)) - { - enum reg_note kind = REG_NOTE_KIND (note); - if (kind == REG_DEAD || kind == REG_UNUSED) - { - rtx reg = XEXP (note, 0); - gcc_assert (HARD_REGISTER_P (reg)); - - if (REGNO (reg) == base_regno) - { - found_note = true; - if (kind == REG_DEAD - && reg_set_p (*chain->loc, chain->insn)) - remove_note (chain->insn, note); - else - XEXP (note, 0) = *chain->loc; - break; - } - } - } } df_insn_rescan (chain->insn); } - if (!found_note) - { - /* If the chain's first insn is the same as the last, we should have - found a REG_UNUSED note. */ - gcc_assert (head->first->insn != head->last->insn); - if (!reg_set_p (*head->last->loc, head->last->insn)) - add_reg_note (head->last->insn, REG_DEAD, *head->last->loc); - } }