aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-06-12 22:31:14 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-06-12 22:31:14 +0000
commit5284e55987deac1dede0b03f5a27413051c6b02b (patch)
tree04502798041680f8013e99050bfef168da606090 /gcc/rtlanal.c
parent6044eae783cea564ad65fe65646346cb67760934 (diff)
downloadgcc-5284e55987deac1dede0b03f5a27413051c6b02b.zip
gcc-5284e55987deac1dede0b03f5a27413051c6b02b.tar.gz
gcc-5284e55987deac1dede0b03f5a27413051c6b02b.tar.bz2
Use poly_int rtx accessors instead of hwi accessors
This patch generalises various places that used hwi rtx accessors so that they can handle poly_ints instead. In many cases these changes are by inspection rather than because something had shown them to be necessary. 2018-06-12 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * poly-int.h (can_div_trunc_p): Add new overload in which all values are poly_ints. * alias.c (get_addr): Extend CONST_INT handling to poly_int_rtx_p. (memrefs_conflict_p): Likewise. (init_alias_analysis): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (combine_simplify_rtx, force_int_to_mode): Likewise. * cse.c (fold_rtx): Likewise. * explow.c (adjust_stack, anti_adjust_stack): Likewise. * expr.c (emit_block_move_hints): Likewise. (clear_storage_hints, push_block, emit_push_insn): Likewise. (store_expr_with_bounds, reduce_to_bit_field_precision): Likewise. (emit_group_load_1): Use rtx_to_poly_int64 for group offsets. (emit_group_store): Likewise. (find_args_size_adjust): Use strip_offset. Use rtx_to_poly_int64 to read the PRE/POST_MODIFY increment. * calls.c (store_one_arg): Use strip_offset. * rtlanal.c (rtx_addr_can_trap_p_1): Extend CONST_INT handling to poly_int_rtx_p. (set_noop_p): Use rtx_to_poly_int64 for the elements selected by a VEC_SELECT. * simplify-rtx.c (avoid_constant_pool_reference): Use strip_offset. (simplify_binary_operation_1): Extend CONST_INT handling to poly_int_rtx_p. * var-tracking.c (compute_cfa_pointer): Take a poly_int64 rather than a HOST_WIDE_INT. (hard_frame_pointer_adjustment): Change from HOST_WIDE_INT to poly_int64. (adjust_mems, add_stores): Update accodingly. (vt_canonicalize_addr): Track polynomial offsets. (emit_note_insn_var_location): Likewise. (vt_add_function_parameter): Likewise. (vt_initialize): Likewise. From-SVN: r261530
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index ac3662d..8e8ee6e 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -462,6 +462,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, poly_int64 offset, poly_int64 size,
{
enum rtx_code code = GET_CODE (x);
gcc_checking_assert (mode == BLKmode || known_size_p (size));
+ poly_int64 const_x1;
/* The offset must be a multiple of the mode size if we are considering
unaligned memory references on strict alignment machines. */
@@ -653,8 +654,8 @@ rtx_addr_can_trap_p_1 (const_rtx x, poly_int64 offset, poly_int64 size,
return 0;
/* - or it is an address that can't trap plus a constant integer. */
- if (CONST_INT_P (XEXP (x, 1))
- && !rtx_addr_can_trap_p_1 (XEXP (x, 0), offset + INTVAL (XEXP (x, 1)),
+ if (poly_int_rtx_p (XEXP (x, 1), &const_x1)
+ && !rtx_addr_can_trap_p_1 (XEXP (x, 0), offset + const_x1,
size, mode, unaligned_mems))
return 0;
@@ -1613,11 +1614,11 @@ set_noop_p (const_rtx set)
int i;
rtx par = XEXP (src, 1);
rtx src0 = XEXP (src, 0);
- int c0 = INTVAL (XVECEXP (par, 0, 0));
- HOST_WIDE_INT offset = GET_MODE_UNIT_SIZE (GET_MODE (src0)) * c0;
+ poly_int64 c0 = rtx_to_poly_int64 (XVECEXP (par, 0, 0));
+ poly_int64 offset = GET_MODE_UNIT_SIZE (GET_MODE (src0)) * c0;
for (i = 1; i < XVECLEN (par, 0); i++)
- if (INTVAL (XVECEXP (par, 0, i)) != c0 + i)
+ if (maybe_ne (rtx_to_poly_int64 (XVECEXP (par, 0, i)), c0 + i))
return 0;
return
simplify_subreg_regno (REGNO (src0), GET_MODE (src0),