From: Richard Sandiford Date: Thu, 28 Aug 2014 06:22:46 +0000 (+0000) Subject: ddg.c: Include rtl-iter.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbf3fc0fc96c5542f982b68873e2ff8330f8c0c6;p=gcc.git ddg.c: Include rtl-iter.h. gcc/ * ddg.c: Include rtl-iter.h. (mark_mem_use_1): Rename to... (mark_mem_use): ...deleting old mark_mem_use. Use FOR_EACH_SUBRTX instead of for_each_rtx. (mem_read_insn_p): Update accordingly. From-SVN: r214632 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d733dd4436..89efc15e6b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-08-28 Richard Sandiford + + * ddg.c: Include rtl-iter.h. + (mark_mem_use_1): Rename to... + (mark_mem_use): ...deleting old mark_mem_use. Use FOR_EACH_SUBRTX + instead of for_each_rtx. + (mem_read_insn_p): Update accordingly. + 2014-08-28 Richard Sandiford * cse.c (change_cc_mode_args): Delete. diff --git a/gcc/ddg.c b/gcc/ddg.c index 1971ef884f3..7514c11dc5d 100644 --- a/gcc/ddg.c +++ b/gcc/ddg.c @@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "bitmap.h" #include "ddg.h" +#include "rtl-iter.h" #ifdef INSN_SCHEDULING @@ -62,20 +63,17 @@ static void add_edge_to_ddg (ddg_ptr g, ddg_edge_ptr); /* Auxiliary variable for mem_read_insn_p/mem_write_insn_p. */ static bool mem_ref_p; -/* Auxiliary function for mem_read_insn_p. */ -static int -mark_mem_use (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - if (MEM_P (*x)) - mem_ref_p = true; - return 0; -} - /* Auxiliary function for mem_read_insn_p. */ static void -mark_mem_use_1 (rtx *x, void *data) +mark_mem_use (rtx *x, void *) { - for_each_rtx (x, mark_mem_use, data); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, *x, NONCONST) + if (MEM_P (*x)) + { + mem_ref_p = true; + break; + } } /* Returns nonzero if INSN reads from memory. */ @@ -83,7 +81,7 @@ static bool mem_read_insn_p (rtx_insn *insn) { mem_ref_p = false; - note_uses (&PATTERN (insn), mark_mem_use_1, NULL); + note_uses (&PATTERN (insn), mark_mem_use, NULL); return mem_ref_p; }