From patchwork Sun Aug 3 14:10:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 376035 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7E04D1400AA for ; Mon, 4 Aug 2014 00:11:00 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=pXS90SuXFbWofVxIO+Rtu7Mqj808O 2ljBztrB0bA6sN6R/4KHI6oSstD0t3kmuml6lUxyyC5EM2LIiLlkg8g8eCMWdg5V qoinjdSOaNy2MkaTJ7MD8jWkaVQelhpDeCZclOgHRbHS8snkcAwVfVrfjroKnvZ1 9t+dMjQTBfx7PU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=3Gr92+jYtun72lqKUStM7yndpJ8=; b=VHk uUIgMOy3DuSeSkjFqBb3neE6V3gArhDnphoWlwa1uG1/23v985QhLvbujFDtHXQw ZKy3daH+MJkWXfcsBfp+cYD6TL1CGs/F9l54AYEIaQUITg5xz7m2jwTPaHJf7CxY VwsPC2bQP4Z2IAqPQQd3i5g7aHacj/9a6XUurATU= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 15:10:48 +0100 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 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)