diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:18:21 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:18:21 +0000 |
commit | 0f5d092808f4385d7618ba8463ad0d8843cc243c (patch) | |
tree | 7677e62ae446a27986459eb4c18a4c43a32dfe67 | |
parent | 7b4df2bf95d2254756f6509ee57a90c398baf81b (diff) | |
download | gcc-0f5d092808f4385d7618ba8463ad0d8843cc243c.zip gcc-0f5d092808f4385d7618ba8463ad0d8843cc243c.tar.gz gcc-0f5d092808f4385d7618ba8463ad0d8843cc243c.tar.bz2 |
poly_int: adjust_mems
This patch makes the var-tracking.c handling of autoinc addresses
cope with polynomial mode sizes.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
Use plus_constant instead of gen_rtx_PLUS.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256156
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/var-tracking.c | 19 |
2 files changed, 15 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9428fe..fb3d07d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,13 @@ Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> + * var-tracking.c (adjust_mems): Treat mode sizes as polynomial. + Use plus_constant instead of gen_rtx_PLUS. + +2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> + Alan Hayward <alan.hayward@arm.com> + David Sherwood <david.sherwood@arm.com> + * config/cr16/cr16-protos.h (cr16_push_rounding): Declare. * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to... * config/cr16/cr16.c (cr16_push_rounding): ...this new function. diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 77281fb..af1afc2 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -1016,6 +1016,7 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) machine_mode mem_mode_save; bool store_save; scalar_int_mode tem_mode, tem_subreg_mode; + poly_int64 size; switch (GET_CODE (loc)) { case REG: @@ -1060,11 +1061,9 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) return mem; case PRE_INC: case PRE_DEC: - addr = gen_rtx_PLUS (GET_MODE (loc), XEXP (loc, 0), - gen_int_mode (GET_CODE (loc) == PRE_INC - ? GET_MODE_SIZE (amd->mem_mode) - : -GET_MODE_SIZE (amd->mem_mode), - GET_MODE (loc))); + size = GET_MODE_SIZE (amd->mem_mode); + addr = plus_constant (GET_MODE (loc), XEXP (loc, 0), + GET_CODE (loc) == PRE_INC ? size : -size); /* FALLTHRU */ case POST_INC: case POST_DEC: @@ -1072,12 +1071,10 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data) addr = XEXP (loc, 0); gcc_assert (amd->mem_mode != VOIDmode && amd->mem_mode != BLKmode); addr = simplify_replace_fn_rtx (addr, old_rtx, adjust_mems, data); - tem = gen_rtx_PLUS (GET_MODE (loc), XEXP (loc, 0), - gen_int_mode ((GET_CODE (loc) == PRE_INC - || GET_CODE (loc) == POST_INC) - ? GET_MODE_SIZE (amd->mem_mode) - : -GET_MODE_SIZE (amd->mem_mode), - GET_MODE (loc))); + size = GET_MODE_SIZE (amd->mem_mode); + tem = plus_constant (GET_MODE (loc), XEXP (loc, 0), + (GET_CODE (loc) == PRE_INC + || GET_CODE (loc) == POST_INC) ? size : -size); store_save = amd->store; amd->store = false; tem = simplify_replace_fn_rtx (tem, old_rtx, adjust_mems, data); |