This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR debug/81570: dwarf2cfi.c: Update cfa.offset in create_pseudo_cfg


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]