On 10/23/2017 11:04 AM, Richard Sandiford wrote: > This patch adds support for DWARF location expressions > that involve polynomial offsets. It adds a target hook that > says how the runtime invariants used in the offsets should be > represented in DWARF. SVE vectors have to be a multiple of > 128 bits in size, so the GCC port uses the number of 128-bit > blocks minus one as the runtime invariant. However, in DWARF, > the vector length is exposed via a pseudo "VG" register that > holds the number of 64-bit elements in a vector. Thus: > > indeterminate 1 == (VG / 2) - 1 > > The hook needs to be general enough to express this. > Note that in most cases the division and subtraction fold > away into surrounding expressions. > > > 2017-10-23 Richard Sandiford <richard.sandif...@linaro.org> > Alan Hayward <alan.hayw...@arm.com> > David Sherwood <david.sherw...@arm.com> > > gcc/ > * target.def (dwarf_poly_indeterminate_value): New hook. > * targhooks.h (default_dwarf_poly_indeterminate_value): Declare. > * targhooks.c (default_dwarf_poly_indeterminate_value): New function. > * doc/tm.texi.in (TARGET_DWARF_POLY_INDETERMINATE_VALUE): Document. > * doc/tm.texi: Regenerate. > * dwarf2out.h (build_cfa_loc, build_cfa_aligned_loc): Take the > offset as a poly_int64. > * dwarf2out.c (new_reg_loc_descr): Move later in file. Take the > offset as a poly_int64. > (loc_descr_plus_const, loc_list_plus_const, build_cfa_aligned_loc): > Take the offset as a poly_int64. > (build_cfa_loc): Likewise. Use loc_descr_plus_const. > (frame_pointer_fb_offset): Change to a poly_int64. > (int_loc_descriptor): Take the offset as a poly_int64. Use > targetm.dwarf_poly_indeterminate_value for polynomial offsets. > (based_loc_descr): Take the offset as a poly_int64. > Use strip_offset_and_add to handle (plus X (const)). > Use new_reg_loc_descr instead of an open-coded version of the > previous implementation. > (mem_loc_descriptor): Handle CONST_POLY_INT. > (compute_frame_pointer_to_fb_displacement): Take the offset as a > poly_int64. Use strip_offset_and_add to handle (plus X (const)). OK. jeff