From daad8a19d17f056a01bf8e00bc1d7dcd793132ff Mon Sep 17 00:00:00 2001 From: rsandifo Date: Thu, 28 Aug 2014 06:22:46 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214632 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/ddg.c | 22 ++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d733dd4436..89efc15e6b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 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. (cse_change_cc_mode): Turn from being a for_each_rtx callback to being a function that examines each subrtx itself. Take the fields of 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 @@ -63,19 +64,16 @@ static void add_edge_to_ddg (ddg_ptr g, ddg_edge_ptr); 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; } -- 2.11.4.GIT