diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-12-20 12:54:44 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-12-20 12:54:44 +0000 |
commit | 21810de45dcfec0ac4141dfa6a59e0f0859aed3e (patch) | |
tree | b9445062124ec0c6049bcfa25ffcbc0dfe5c7113 /gcc/dwarf2out.h | |
parent | fdbfe4e5523f9fe55b7759b2d16b1ce2704fd3ac (diff) | |
download | gcc-21810de45dcfec0ac4141dfa6a59e0f0859aed3e.zip gcc-21810de45dcfec0ac4141dfa6a59e0f0859aed3e.tar.gz gcc-21810de45dcfec0ac4141dfa6a59e0f0859aed3e.tar.bz2 |
poly_int: DWARF CFA offsets
This patch makes the DWARF code use poly_int64 rather than
HOST_WIDE_INT for CFA offsets. The main changes are:
- to make reg_save use a DW_CFA_expression representation when
the offset isn't constant and
- to record the CFA information alongside a def_cfa_expression
if either offset is polynomial, since it's quite difficult
to reconstruct the CFA information otherwise.
2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* gengtype.c (main): Handle poly_int64_pod.
* dwarf2out.h (dw_cfi_oprnd_cfa_loc): New dw_cfi_oprnd_type.
(dw_cfi_oprnd::dw_cfi_cfa_loc): New field.
(dw_cfa_location::offset, dw_cfa_location::base_offset): Change
from HOST_WIDE_INT to poly_int64_pod.
* dwarf2cfi.c (queued_reg_save::cfa_offset): Likewise.
(copy_cfa): New function.
(lookup_cfa_1): Use the cached dw_cfi_cfa_loc, if it exists.
(cfi_oprnd_equal_p): Handle dw_cfi_oprnd_cfa_loc.
(cfa_equal_p, dwarf2out_frame_debug_adjust_cfa)
(dwarf2out_frame_debug_cfa_offset, dwarf2out_frame_debug_expr)
(initial_return_save): Treat offsets as poly_ints.
(def_cfa_0): Likewise. Cache the CFA in dw_cfi_cfa_loc if either
offset is nonconstant.
(reg_save): Take the offset as a poly_int64. Fall back to
DW_CFA_expression for nonconstant offsets.
(queue_reg_save): Take the offset as a poly_int64.
* dwarf2out.c (dw_cfi_oprnd2_desc): Handle DW_CFA_def_cfa_expression.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255884
Diffstat (limited to 'gcc/dwarf2out.h')
-rw-r--r-- | gcc/dwarf2out.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 140724c..abaa9d0 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -43,7 +43,8 @@ enum dw_cfi_oprnd_type { dw_cfi_oprnd_reg_num, dw_cfi_oprnd_offset, dw_cfi_oprnd_addr, - dw_cfi_oprnd_loc + dw_cfi_oprnd_loc, + dw_cfi_oprnd_cfa_loc }; typedef union GTY(()) { @@ -51,6 +52,8 @@ typedef union GTY(()) { HOST_WIDE_INT GTY ((tag ("dw_cfi_oprnd_offset"))) dw_cfi_offset; const char * GTY ((tag ("dw_cfi_oprnd_addr"))) dw_cfi_addr; struct dw_loc_descr_node * GTY ((tag ("dw_cfi_oprnd_loc"))) dw_cfi_loc; + struct dw_cfa_location * GTY ((tag ("dw_cfi_oprnd_cfa_loc"))) + dw_cfi_cfa_loc; } dw_cfi_oprnd; struct GTY(()) dw_cfi_node { @@ -114,8 +117,8 @@ struct GTY(()) dw_fde_node { Instead of passing around REG and OFFSET, we pass a copy of this structure. */ struct GTY(()) dw_cfa_location { - HOST_WIDE_INT offset; - HOST_WIDE_INT base_offset; + poly_int64_pod offset; + poly_int64_pod base_offset; /* REG is in DWARF_FRAME_REGNUM space, *not* normal REGNO space. */ unsigned int reg; BOOL_BITFIELD indirect : 1; /* 1 if CFA is accessed via a dereference. */ |