From 0f5d092808f4385d7618ba8463ad0d8843cc243c Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 3 Jan 2018 07:18:21 +0000 Subject: [PATCH] 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 Alan Hayward David Sherwood gcc/ * var-tracking.c (adjust_mems): Treat mode sizes as polynomial. Use plus_constant instead of gen_rtx_PLUS. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r256156 --- gcc/ChangeLog | 7 +++++++ gcc/var-tracking.c | 19 ++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9428fe63c6..fb3d07de0a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-03 Richard Sandiford + Alan Hayward + David Sherwood + + * var-tracking.c (adjust_mems): Treat mode sizes as polynomial. + Use plus_constant instead of gen_rtx_PLUS. + 2018-01-03 Richard Sandiford Alan Hayward David Sherwood diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 77281fb45ee..af1afc281d1 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); -- 2.30.2