diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-08-28 06:23:26 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-08-28 06:23:26 +0000 |
commit | aa4e2d7ef0684e2f49279228c691d12a2c3c1544 (patch) | |
tree | 5ce2ad43e445eeddc8f9c53e194202e2c0f54aa0 /gcc | |
parent | b87048010c87e66ae5c2d329cf12541a16812ac0 (diff) | |
download | gcc-aa4e2d7ef0684e2f49279228c691d12a2c3c1544.zip gcc-aa4e2d7ef0684e2f49279228c691d12a2c3c1544.tar.gz gcc-aa4e2d7ef0684e2f49279228c691d12a2c3c1544.tar.bz2 |
fwprop.c: Include rtl-iter.h.
gcc/
* fwprop.c: Include rtl-iter.h.
(varying_mem_p): Turn from being a for_each_rtx callback to being
a function that examines each subrtx itself.
(propagate_rtx): Update accordingly.
From-SVN: r214641
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fwprop.c | 17 |
2 files changed, 17 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fa795a..36b25cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2014-08-28 Richard Sandiford <rdsandiford@googlemail.com> + * fwprop.c: Include rtl-iter.h. + (varying_mem_p): Turn from being a for_each_rtx callback to being + a function that examines each subrtx itself. + (propagate_rtx): Update accordingly. + +2014-08-28 Richard Sandiford <rdsandiford@googlemail.com> + * function.c: Include rtl-iter.h (instantiate_virtual_regs_in_rtx): Turn from being a for_each_rtx callback to being a function that examines each subrtx itself. diff --git a/gcc/fwprop.c b/gcc/fwprop.c index e9ee25e..f166bde 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "domwalk.h" #include "emit-rtl.h" +#include "rtl-iter.h" /* This pass does simple forward propagation and simplification when an @@ -623,14 +624,16 @@ propagate_rtx_1 (rtx *px, rtx old_rtx, rtx new_rtx, int flags) } -/* for_each_rtx traversal function that returns 1 if BODY points to - a non-constant mem. */ +/* Return true if X constains a non-constant mem. */ -static int -varying_mem_p (rtx *body, void *data ATTRIBUTE_UNUSED) +static bool +varying_mem_p (const_rtx x) { - rtx x = *body; - return MEM_P (x) && !MEM_READONLY_P (x); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, x, NONCONST) + if (MEM_P (*iter) && !MEM_READONLY_P (*iter)) + return true; + return false; } @@ -661,7 +664,7 @@ propagate_rtx (rtx x, enum machine_mode mode, rtx old_rtx, rtx new_rtx, && (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (new_rtx)))))) flags |= PR_CAN_APPEAR; - if (!for_each_rtx (&new_rtx, varying_mem_p, NULL)) + if (!varying_mem_p (new_rtx)) flags |= PR_HANDLE_MEM; if (speed) |