From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19173 invoked by alias); 3 Aug 2014 14:35:37 -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 19156 invoked by uid 89); 3 Aug 2014 14:35:35 -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-f173.google.com Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com) (74.125.82.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 03 Aug 2014 14:35:29 +0000 Received: by mail-we0-f173.google.com with SMTP id q58so6492968wes.4 for ; Sun, 03 Aug 2014 07:35:26 -0700 (PDT) X-Received: by 10.194.3.74 with SMTP id a10mr24561434wja.85.1407076526790; Sun, 03 Aug 2014 07:35:26 -0700 (PDT) Received: from localhost ([95.145.138.172]) by mx.google.com with ESMTPSA id es9sm36264491wjd.1.2014.08.03.07.35.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Aug 2014 07:35:26 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [PATCH 44/50] var-tracking.c:rtx_debug_expr_p References: <87y4v5d77q.fsf@googlemail.com> Date: Sun, 03 Aug 2014 14:35:00 -0000 In-Reply-To: <87y4v5d77q.fsf@googlemail.com> (Richard Sandiford's message of "Sun, 03 Aug 2014 14:38:01 +0100") Message-ID: <87oaw163pu.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/msg00181.txt.bz2 gcc/ * var-tracking.c: Include rtl-iter.h. (rtx_debug_expr_p): Turn from being a for_each_rtx callback to being a function that examines each subrtx itself. (use_type): Update accordingly. Index: gcc/var-tracking.c =================================================================== --- gcc/var-tracking.c 2014-08-03 11:23:46.439128910 +0100 +++ gcc/var-tracking.c 2014-08-03 11:25:32.493177423 +0100 @@ -119,6 +119,7 @@ #include "recog.h" #include "tm_p.h" #include "alias.h" +#include "rtl-iter.h" /* var-tracking.c assumes that tree code with the same value as VALUE rtx code has no chance to appear in REG_EXPR/MEM_EXPRs and isn't a decl. @@ -5366,16 +5367,16 @@ replace_expr_with_values (rtx loc) return cselib_subst_to_values (loc, VOIDmode); } -/* Return true if *X is a DEBUG_EXPR. Usable as an argument to - for_each_rtx to tell whether there are any DEBUG_EXPRs within - RTX. */ +/* Return true if X contains a DEBUG_EXPR. */ -static int -rtx_debug_expr_p (rtx *x, void *data ATTRIBUTE_UNUSED) +static bool +rtx_debug_expr_p (const_rtx x) { - rtx loc = *x; - - return GET_CODE (loc) == DEBUG_EXPR; + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, x, ALL) + if (GET_CODE (*iter) == DEBUG_EXPR) + return true; + return false; } /* Determine what kind of micro operation to choose for a USE. Return @@ -5465,7 +5466,7 @@ use_type (rtx loc, struct count_use_info DEBUG_EXPRs (only happens in the presence of debug insns). */ && (!MAY_HAVE_DEBUG_INSNS - || !for_each_rtx (&XEXP (loc, 0), rtx_debug_expr_p, NULL))) + || !rtx_debug_expr_p (XEXP (loc, 0)))) return MO_USE; else return MO_CLOBBER;