From 2caafc4476400a74b975f65228e91ecffc769761 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 26 Oct 2014 10:40:22 +0000 Subject: [PATCH] sh.c (sh_contains_memref_p_1): Delete. gcc/ * config/sh/sh.c (sh_contains_memref_p_1): Delete. (sh_contains_memref_p): Use FOR_EACH_SUBRTX. From-SVN: r216702 --- gcc/ChangeLog | 5 +++++ gcc/config/sh/sh.c | 15 ++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c33e0e5033e..b7a51a41879 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-26 Richard Sandiford + + * config/sh/sh.c (sh_contains_memref_p_1): Delete. + (sh_contains_memref_p): Use FOR_EACH_SUBRTX. + 2014-10-26 Richard Sandiford * config/sh/sh-protos.h (shmedia_cleanup_truncate): Take an diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 2d1a9273a75..2b1f98bba49 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -12972,18 +12972,15 @@ shmedia_cleanup_truncate (rtx x) so we must look at the rtl ourselves to see if any of the feeding registers is used in a memref. - Called by sh_contains_memref_p via for_each_rtx. */ -static int -sh_contains_memref_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - return (MEM_P (*loc)); -} - -/* Return true iff INSN contains a MEM. */ + Return true iff INSN contains a MEM. */ bool sh_contains_memref_p (rtx insn) { - return for_each_rtx (&PATTERN (insn), &sh_contains_memref_p_1, NULL); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST) + if (MEM_P (*iter)) + return true; + return false; } /* Return true iff INSN loads a banked register. */ -- 2.30.2