From: David Malcolm Date: Fri, 22 Aug 2014 20:06:25 +0000 (+0000) Subject: print-rtl.c: Use rtx_insn for various debug_ functions X-Git-Tag: releases/gcc-5.1.0~5220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f719babc10087fe48eef73d81fb50654785e950d;p=thirdparty%2Fgcc.git print-rtl.c: Use rtx_insn for various debug_ functions 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. From-SVN: r214362 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef34753341c6..d47b69bc2193 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2014-08-22 David Malcolm + + * 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. + 2014-08-22 David Malcolm * predict.h (predict_insn_def): Strengthen param "insn" from rtx diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c8562cc97d8e..00fa0709a550 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -6813,7 +6813,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 5dc8e94411a0..be1d01ac6c35 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -699,14 +699,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; @@ -727,10 +728,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) { @@ -742,12 +744,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); @@ -772,7 +774,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; @@ -792,7 +794,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 82d694ed7f0a..aa3f8d0d8207 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3132,9 +3132,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);