From patchwork Sun Aug 3 14:38: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: 376058 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 A0E691400AA for ; Mon, 4 Aug 2014 00:39: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=PySAEmkYtjnt9GOH8V7FBfoyw3dh2 klBS3cQoZttVZL4ow8OvCpQd0SS4dy4QGnBLVSYIGCZEeAD37puqRDQVS+Yl4LfO 4ToEF+OAaC8l5NfeRu5I6sW2Zo6QCAm+pUBHBSYSVXVoBLyboPm8Sll4sxsCQ9Qd WGTDiZSafsw7j8= 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=62kHpruXWqqU/yx78vlRWSOGQ/c=; b=UUR /buGpPLzlZGn8Z7UH8Iw2y/a1Zmtt6Jajbw/OGtO7QJiE2ypW7Mx3kBx1XImVGth YvbZSyBLu9YLC2n+11fma7kbKDb1F1hDa4c7MiOhJ4tfUcj89hXUajkhJfoFaQvL DbQ+csspuMa3JDHBsXF9HhITrP1E7SGFR33RtehU= Received: (qmail 23739 invoked by alias); 3 Aug 2014 14:38:54 -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 23729 invoked by uid 89); 3 Aug 2014 14:38: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-we0-f171.google.com Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com) (74.125.82.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 03 Aug 2014 14:38:53 +0000 Received: by mail-we0-f171.google.com with SMTP id p10so6518927wes.2 for ; Sun, 03 Aug 2014 07:38:50 -0700 (PDT) X-Received: by 10.180.21.208 with SMTP id x16mr22389786wie.73.1407076730147; Sun, 03 Aug 2014 07:38:50 -0700 (PDT) Received: from localhost ([95.145.138.172]) by mx.google.com with ESMTPSA id bt9sm954931wjc.40.2014.08.03.07.38.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Aug 2014 07:38:49 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [PATCH 47/50] var-tracking.c:add_uses References: <87y4v5d77q.fsf@googlemail.com> Date: Sun, 03 Aug 2014 15:38:48 +0100 In-Reply-To: <87y4v5d77q.fsf@googlemail.com> (Richard Sandiford's message of "Sun, 03 Aug 2014 14:38:01 +0100") Message-ID: <87bns163k7.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 gcc/ * var-tracking.c (add_uses): Take an rtx rather than an rtx *. Give real type of data parameter. Remove return value. (add_uses_1): Use FOR_EACH_SUBRTX_VAR rather than for_each_rtx to iterate over subrtxes. Index: gcc/var-tracking.c =================================================================== --- gcc/var-tracking.c 2014-08-03 11:25:33.067183098 +0100 +++ gcc/var-tracking.c 2014-08-03 11:25:33.326185659 +0100 @@ -666,7 +666,6 @@ static void dataflow_set_destroy (datafl static bool contains_symbol_ref (rtx); static bool track_expr_p (tree, bool); static bool same_variable_part_p (rtx, tree, HOST_WIDE_INT); -static int add_uses (rtx *, void *); static void add_uses_1 (rtx *, void *); static void add_stores (rtx, const_rtx, void *); static bool compute_bb_dataflow (basic_block); @@ -5552,14 +5551,12 @@ non_suitable_const (const_rtx x) } /* Add uses (register and memory references) LOC which will be tracked - to VTI (bb)->mos. INSN is instruction which the LOC is part of. */ + to VTI (bb)->mos. */ -static int -add_uses (rtx *ploc, void *data) +static void +add_uses (rtx loc, struct count_use_info *cui) { - rtx loc = *ploc; enum machine_mode mode = VOIDmode; - struct count_use_info *cui = (struct count_use_info *)data; enum micro_operation_type type = use_type (loc, cui, &mode); if (type != MO_CLOBBER) @@ -5705,8 +5702,6 @@ add_uses (rtx *ploc, void *data) log_op_type (mo.u.loc, cui->bb, cui->insn, mo.type, dump_file); VTI (bb)->mos.safe_push (mo); } - - return 0; } /* Helper function for finding all uses of REG/MEM in X in insn INSN. */ @@ -5714,7 +5709,9 @@ add_uses (rtx *ploc, void *data) static void add_uses_1 (rtx *x, void *cui) { - for_each_rtx (x, add_uses, cui); + subrtx_var_iterator::array_type array; + FOR_EACH_SUBRTX_VAR (iter, array, *x, NONCONST) + add_uses (*iter, (struct count_use_info *) cui); } /* This is the value used during expansion of locations. We want it