From 84bc717b510cc56f64120dd58c64e1f6ebfad5e3 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 20 Dec 2017 12:52:22 +0000 Subject: poly_int: REG_OFFSET This patch changes the type of the reg_attrs offset field from HOST_WIDE_INT to poly_int64 and updates uses accordingly. This includes changing reg_attr_hasher::hash to use inchash. (Doing this has no effect on code generation since the only use of the hasher is to avoid creating duplicate objects.) 2017-12-20 Richard Sandiford Alan Hayward David Sherwood gcc/ * rtl.h (reg_attrs::offset): Change from HOST_WIDE_INT to poly_int64. (gen_rtx_REG_offset): Take the offset as a poly_int64. * inchash.h (inchash::hash::add_poly_hwi): New function. * gengtype.c (main): Register poly_int64. * emit-rtl.c (reg_attr_hasher::hash): Use inchash. Treat the offset as a poly_int. (reg_attr_hasher::equal): Use must_eq to compare offsets. (get_reg_attrs, update_reg_offset, gen_rtx_REG_offset): Take the offset as a poly_int64. (set_reg_attrs_from_value): Treat the offset as a poly_int64. * print-rtl.c (print_poly_int): New function. (rtx_writer::print_rtx_operand_code_r): Treat REG_OFFSET as a poly_int. * var-tracking.c (track_offset_p, get_tracked_reg_offset): New functions. (var_reg_set, var_reg_delete_and_set, var_reg_delete): Use them. (same_variable_part_p, track_loc_p): Take the offset as a poly_int64. (vt_get_decl_and_offset): Return the offset as a poly_int64. Enforce track_offset_p for parts of a PARALLEL. (vt_add_function_parameter): Use const_offset for the final offset to track. Use get_tracked_reg_offset for the parts of a PARALLEL. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r255867 --- gcc/rtl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/rtl.h') diff --git a/gcc/rtl.h b/gcc/rtl.h index 7b2560d..ed944a4 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -187,7 +187,7 @@ struct GTY(()) mem_attrs struct GTY((for_user)) reg_attrs { tree decl; /* decl corresponding to REG. */ - HOST_WIDE_INT offset; /* Offset from start of DECL. */ + poly_int64 offset; /* Offset from start of DECL. */ }; /* Common union for an element of an rtx. */ @@ -3023,7 +3023,7 @@ subreg_promoted_mode (rtx x) extern rtvec gen_rtvec_v (int, rtx *); extern rtvec gen_rtvec_v (int, rtx_insn **); extern rtx gen_reg_rtx (machine_mode); -extern rtx gen_rtx_REG_offset (rtx, machine_mode, unsigned int, int); +extern rtx gen_rtx_REG_offset (rtx, machine_mode, unsigned int, poly_int64); extern rtx gen_reg_rtx_offset (rtx, machine_mode, int); extern rtx gen_reg_rtx_and_attrs (rtx); extern rtx_code_label *gen_label_rtx (void); -- cgit v1.1