From c8412f9770056dff19e3470901193784c7764bcf Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 30 Jun 2011 14:01:06 -0700 Subject: [PATCH] dwarf2out: Handle pc_rtx as return column in REG_CFA_OFFSET too. * dwarf2out.c (dwarf2out_frame_debug_cfa_offset): Allow PC_RTX as a source, and interpret that as DWARF_FRAME_RETURN_COLUMN. From-SVN: r175728 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 277fc9eb276..2358289f64f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-06-30 Richard Henderson + + * dwarf2out.c (dwarf2out_frame_debug_cfa_offset): Allow PC_RTX + as a source, and interpret that as DWARF_FRAME_RETURN_COLUMN. + 2011-06-30 Richard Henderson * dwarf2out.c (struct reg_saved_in_data): Provide a typedef. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8aa2eb2d4d1..8e543919ffe 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1982,6 +1982,7 @@ dwarf2out_frame_debug_cfa_offset (rtx set, const char *label) { HOST_WIDE_INT offset; rtx src, addr, span; + unsigned int sregno; src = XEXP (set, 1); addr = XEXP (set, 0); @@ -2003,12 +2004,21 @@ dwarf2out_frame_debug_cfa_offset (rtx set, const char *label) gcc_unreachable (); } - span = targetm.dwarf_register_span (src); + if (src == pc_rtx) + { + span = NULL; + sregno = DWARF_FRAME_RETURN_COLUMN; + } + else + { + span = targetm.dwarf_register_span (src); + sregno = DWARF_FRAME_REGNUM (REGNO (src)); + } /* ??? We'd like to use queue_reg_save, but we need to come up with a different flushing heuristic for epilogues. */ if (!span) - reg_save (label, DWARF_FRAME_REGNUM (REGNO (src)), INVALID_REGNUM, offset); + reg_save (label, sregno, INVALID_REGNUM, offset); else { /* We have a PARALLEL describing where the contents of SRC live. @@ -2024,8 +2034,8 @@ dwarf2out_frame_debug_cfa_offset (rtx set, const char *label) { rtx elem = XVECEXP (span, 0, par_index); - reg_save (label, DWARF_FRAME_REGNUM (REGNO (elem)), - INVALID_REGNUM, span_offset); + sregno = DWARF_FRAME_REGNUM (REGNO (src)); + reg_save (label, sregno, INVALID_REGNUM, span_offset); span_offset += GET_MODE_SIZE (GET_MODE (elem)); } } -- 2.30.2