From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15665 invoked by alias); 3 Aug 2014 14:10:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 15655 invoked by uid 89); 3 Aug 2014 14:10:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f42.google.com Received: from mail-wg0-f42.google.com (HELO mail-wg0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 03 Aug 2014 14:10:52 +0000 Received: by mail-wg0-f42.google.com with SMTP id l18so6435983wgh.25 for ; Sun, 03 Aug 2014 07:10:49 -0700 (PDT) X-Received: by 10.194.84.69 with SMTP id w5mr24528956wjy.0.1407075049264; Sun, 03 Aug 2014 07:10:49 -0700 (PDT) Received: from localhost ([95.145.138.172]) by mx.google.com with ESMTPSA id eh10sm30321121wic.0.2014.08.03.07.10.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Aug 2014 07:10:48 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [PATCH 25/50] ira.c:set_paradoxical_subreg References: <87y4v5d77q.fsf@googlemail.com> Date: Sun, 03 Aug 2014 14:10:00 -0000 In-Reply-To: <87y4v5d77q.fsf@googlemail.com> (Richard Sandiford's message of "Sun, 03 Aug 2014 14:38:01 +0100") Message-ID: <87y4v58xzr.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-08/txt/msg00161.txt.bz2 gcc/ * ira.c: Include rtl-iter.h. (set_paradoxical_subreg): Turn from being a for_each_rtx callback to being a function that examines each subrtx itself. Remove handling of null rtxes. (update_equiv_regs): Update call accordingly. Index: gcc/ira.c =================================================================== --- gcc/ira.c 2014-08-03 11:25:09.975954805 +0100 +++ gcc/ira.c 2014-08-03 11:25:27.162124717 +0100 @@ -392,6 +392,7 @@ Software Foundation; either version 3, o #include "lra.h" #include "dce.h" #include "dbgcnt.h" +#include "rtl-iter.h" struct target_ira default_target_ira; struct target_ira_int default_target_ira_int; @@ -3265,23 +3266,20 @@ no_equiv (rtx reg, const_rtx store ATTRI /* Check whether the SUBREG is a paradoxical subreg and set the result in PDX_SUBREGS. */ -static int -set_paradoxical_subreg (rtx *subreg, void *pdx_subregs) +static void +set_paradoxical_subreg (rtx insn, bool *pdx_subregs) { - rtx reg; - - if ((*subreg) == NULL_RTX) - return 1; - if (GET_CODE (*subreg) != SUBREG) - return 0; - reg = SUBREG_REG (*subreg); - if (!REG_P (reg)) - return 0; - - if (paradoxical_subreg_p (*subreg)) - ((bool *)pdx_subregs)[REGNO (reg)] = true; - - return 0; + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST) + { + const_rtx subreg = *iter; + if (GET_CODE (subreg) == SUBREG) + { + const_rtx reg = SUBREG_REG (subreg); + if (REG_P (reg) && paradoxical_subreg_p (subreg)) + pdx_subregs[REGNO (reg)] = true; + } + } } /* In DEBUG_INSN location adjust REGs from CLEARED_REGS bitmap to the @@ -3344,7 +3342,7 @@ update_equiv_regs (void) FOR_EACH_BB_FN (bb, cfun) FOR_BB_INSNS (bb, insn) if (NONDEBUG_INSN_P (insn)) - for_each_rtx (&insn, set_paradoxical_subreg, (void *) pdx_subregs); + set_paradoxical_subreg (insn, pdx_subregs); /* Scan the insns and find which registers have equivalences. Do this in a separate scan of the insns because (due to -fcse-follow-jumps)