This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR debug/81570: dwarf2cfi.c: Update cfa.offset in create_pseudo_cfg
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Thu, 27 Jul 2017 12:50:14 -0700
- Subject: [PATCH] PR debug/81570: dwarf2cfi.c: Update cfa.offset in create_pseudo_cfg
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
execute_dwarf2_frame is called for each funtion. But create_cie_data
is called only once to initialize cie_cfi_row for all functions. Since
INCOMING_FRAME_SP_OFFSET may be different for each function, we can't
use the same INCOMING_FRAME_SP_OFFSET in cie_cfi_row for all functions.
This patch sets cie_cfi_row->cfa.offset to INCOMING_FRAME_SP_OFFSET in
create_pseudo_cfg which is called for each function.
Tested on x86-64. OK for trunk?
Thanks.
H.J.
PR debug/81570
* dwarf2cfi.c (create_pseudo_cfg): Set cie_cfi_row->cfa.offset
to INCOMING_FRAME_SP_OFFSET.
---
gcc/dwarf2cfi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index a5f9832fc4a..c40f31d2f20 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -2831,6 +2831,9 @@ create_pseudo_cfg (void)
memset (&ti, 0, sizeof (ti));
ti.head = get_insns ();
ti.beg_row = cie_cfi_row;
+ /* Set cfa.offset to INCOMING_FRAME_SP_OFFSET here since it may be
+ different for each function. */
+ cie_cfi_row->cfa.offset = INCOMING_FRAME_SP_OFFSET;
ti.cfa_store = cie_cfi_row->cfa;
ti.cfa_temp.reg = INVALID_REGNUM;
trace_info.quick_push (ti);
--
2.13.3