From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29259 invoked by alias); 6 Aug 2014 17:44:04 -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 29205 invoked by uid 89); 6 Aug 2014 17:44:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 06 Aug 2014 17:44:02 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF4ta-00019M-2F for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:21:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4tZ-000199-Rs for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:21:02 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76HK1nc028894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 13:20:01 -0400 Received: from c64.redhat.com (vpn-239-139.phx2.redhat.com [10.3.239.139]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJ2pG030913; Wed, 6 Aug 2014 13:20:00 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 100/236] print-rtl.c: Use rtx_insn for various debug_ functions (also touches config/rs6000/rs6000.c) Date: Wed, 06 Aug 2014 17:44:00 -0000 Message-Id: <1407345815-14551-101-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00672.txt.bz2 gcc/ * rtl.h (debug_rtx_list): Strengthen param 1 "x" from const_rtx to const rtx_insn *. (debug_rtx_range): Likewise for params 1 and 2 "start" and "end". (debug_rtx_find): Likewise for param 1 "x". * print-rtl.c (debug_rtx_list): Strengthen param 1 "x" from const_rtx to const rtx_insn *. Likewise for local "insn". (debug_rtx_range): Likewise for params 1 and 2 "start" and "end". (debug_rtx_find): Likewise for param 1 "x". (print_rtl): Likewise for local "tmp_rtx", adding a checked cast from const_rtx to const rtx_insn * within the appropriate cases of the switch statement. * config/rs6000/rs6000.c (rs6000_debug_legitimize_address): Strengthen local "insns" from rtx to rtx_insn * since this is passed to a call to debug_rtx_list. --- gcc/config/rs6000/rs6000.c | 2 +- gcc/print-rtl.c | 24 ++++++++++++++---------- gcc/rtl.h | 6 +++--- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 8d80146..5faf329 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -6737,7 +6737,7 @@ static rtx rs6000_debug_legitimize_address (rtx x, rtx oldx, enum machine_mode mode) { rtx ret; - rtx insns; + rtx_insn *insns; start_sequence (); ret = rs6000_legitimize_address (x, oldx, mode); diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 2f9f547..58351ef 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -697,14 +697,15 @@ DEBUG_VARIABLE int debug_rtx_count = 0; /* 0 is treated as equivalent to 1 */ /* Call this function to print list from X on. N is a count of the rtx's to print. Positive values print from the specified - rtx on. Negative values print a window around the rtx. - EG: -5 prints 2 rtx's on either side (in addition to the specified rtx). */ + rtx_insn on. Negative values print a window around the rtx_insn. + EG: -5 prints 2 rtx_insn's on either side (in addition to the specified + rtx_insn). */ DEBUG_FUNCTION void -debug_rtx_list (const_rtx x, int n) +debug_rtx_list (const rtx_insn *x, int n) { int i,count; - const_rtx insn; + const rtx_insn *insn; count = n == 0 ? 1 : n < 0 ? -n : n; @@ -725,10 +726,11 @@ debug_rtx_list (const_rtx x, int n) } } -/* Call this function to print an rtx list from START to END inclusive. */ +/* Call this function to print an rtx_insn list from START to END + inclusive. */ DEBUG_FUNCTION void -debug_rtx_range (const_rtx start, const_rtx end) +debug_rtx_range (const rtx_insn *start, const rtx_insn *end) { while (1) { @@ -740,12 +742,12 @@ debug_rtx_range (const_rtx start, const_rtx end) } } -/* Call this function to search an rtx list to find one with insn uid UID, +/* Call this function to search an rtx_insn list to find one with insn uid UID, and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT. The found insn is returned to enable further debugging analysis. */ DEBUG_FUNCTION const_rtx -debug_rtx_find (const_rtx x, int uid) +debug_rtx_find (const rtx_insn *x, int uid) { while (x != 0 && INSN_UID (x) != uid) x = NEXT_INSN (x); @@ -770,7 +772,7 @@ debug_rtx_find (const_rtx x, int uid) void print_rtl (FILE *outf, const_rtx rtx_first) { - const_rtx tmp_rtx; + const rtx_insn *tmp_rtx; outfile = outf; sawclose = 0; @@ -790,7 +792,9 @@ print_rtl (FILE *outf, const_rtx rtx_first) case CODE_LABEL: case JUMP_TABLE_DATA: case BARRIER: - for (tmp_rtx = rtx_first; tmp_rtx != 0; tmp_rtx = NEXT_INSN (tmp_rtx)) + for (tmp_rtx = as_a (rtx_first); + tmp_rtx != 0; + tmp_rtx = NEXT_INSN (tmp_rtx)) { fputs (print_rtx_head, outfile); print_rtx (tmp_rtx); diff --git a/gcc/rtl.h b/gcc/rtl.h index 759d9be..17da2be 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3105,9 +3105,9 @@ extern const char *print_rtx_head; extern void debug (const rtx_def &ref); extern void debug (const rtx_def *ptr); extern void debug_rtx (const_rtx); -extern void debug_rtx_list (const_rtx, int); -extern void debug_rtx_range (const_rtx, const_rtx); -extern const_rtx debug_rtx_find (const_rtx, int); +extern void debug_rtx_list (const rtx_insn *, int); +extern void debug_rtx_range (const rtx_insn *, const rtx_insn *); +extern const_rtx debug_rtx_find (const rtx_insn *, int); extern void print_mem_expr (FILE *, const_tree); extern void print_rtl (FILE *, const_rtx); extern void print_simple_rtl (FILE *, const_rtx); -- 1.8.5.3