From 722279e41f7d76fc4b3ea8cca0d542c3d5779db2 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Fri, 1 Apr 2011 17:35:13 +0000 Subject: [PATCH] dwarf2out.h (dwarf2out_frame_debug_init): Declare. * dwarf2out.h (dwarf2out_frame_debug_init): Declare. * dwarf2out.c (dwarf2out_frame_debug_init): New function, broken out of ... (dwarf2out_frame_debug): ... here. Don't handle a NULL argument. * final.c (final_start_function): Call the new function rather than using a NULL argument for dwarf2out_frame_debug. From-SVN: r171839 --- gcc/ChangeLog | 9 +++++++ gcc/dwarf2out.c | 66 +++++++++++++++++++++++++------------------------ gcc/dwarf2out.h | 3 ++- gcc/final.c | 2 +- 4 files changed, 46 insertions(+), 34 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c720f82d558..e9fc81a7d0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-04-01 Bernd Schmidt + + * dwarf2out.h (dwarf2out_frame_debug_init): Declare. + * dwarf2out.c (dwarf2out_frame_debug_init): New function, broken + out of ... + (dwarf2out_frame_debug): ... here. Don't handle a NULL argument. + * final.c (final_start_function): Call the new function rather + than using a NULL argument for dwarf2out_frame_debug. + 2011-04-01 Ulrich Weigand * config/spu/t-spu-elf (dp-bit.c): Use > instead of >>. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4b7afe49364..8371b5e4a9c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2788,38 +2788,6 @@ dwarf2out_frame_debug (rtx insn, bool after_p) rtx note, n; bool handled_one = false; - if (insn == NULL_RTX) - { - size_t i; - - /* Flush any queued register saves. */ - dwarf2out_flush_queued_reg_saves (); - - /* Set up state for generating call frame debug info. */ - lookup_cfa (&cfa); - gcc_assert (cfa.reg - == (unsigned long)DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)); - - cfa.reg = STACK_POINTER_REGNUM; - cfa_store = cfa; - cfa_temp.reg = -1; - cfa_temp.offset = 0; - - for (i = 0; i < num_regs_saved_in_regs; i++) - { - regs_saved_in_regs[i].orig_reg = NULL_RTX; - regs_saved_in_regs[i].saved_in_reg = NULL_RTX; - } - num_regs_saved_in_regs = 0; - - if (barrier_args_size) - { - XDELETEVEC (barrier_args_size); - barrier_args_size = NULL; - } - return; - } - if (!NONJUMP_INSN_P (insn) || clobbers_queued_reg_save (insn)) dwarf2out_flush_queued_reg_saves (); @@ -2937,6 +2905,40 @@ dwarf2out_frame_debug (rtx insn, bool after_p) dwarf2out_flush_queued_reg_saves (); } +/* Called once at the start of final to initialize some data for the + current function. */ +void +dwarf2out_frame_debug_init (void) +{ + size_t i; + + /* Flush any queued register saves. */ + dwarf2out_flush_queued_reg_saves (); + + /* Set up state for generating call frame debug info. */ + lookup_cfa (&cfa); + gcc_assert (cfa.reg + == (unsigned long)DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)); + + cfa.reg = STACK_POINTER_REGNUM; + cfa_store = cfa; + cfa_temp.reg = -1; + cfa_temp.offset = 0; + + for (i = 0; i < num_regs_saved_in_regs; i++) + { + regs_saved_in_regs[i].orig_reg = NULL_RTX; + regs_saved_in_regs[i].saved_in_reg = NULL_RTX; + } + num_regs_saved_in_regs = 0; + + if (barrier_args_size) + { + XDELETEVEC (barrier_args_size); + barrier_args_size = NULL; + } +} + /* Determine if we need to save and restore CFI information around this epilogue. If SIBCALL is true, then this is a sibcall epilogue. If we do need to save/restore, then emit the save now, and insert a diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index d5b958dd66c..7f5ac1351ae 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -1,5 +1,5 @@ /* dwarf2out.h - Various declarations for functions found in dwarf2out.c - Copyright (C) 1998, 1999, 2000, 2003, 2007, 2010 + Copyright (C) 1998, 1999, 2000, 2003, 2007, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see extern void dwarf2out_decl (tree); extern void dwarf2out_frame_debug (rtx, bool); +extern void dwarf2out_frame_debug_init (void); extern void dwarf2out_cfi_begin_epilogue (rtx); extern void dwarf2out_frame_debug_restore_state (void); extern void dwarf2out_flush_queued_reg_saves (void); diff --git a/gcc/final.c b/gcc/final.c index 8296169968a..cc7234c9b2d 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1561,7 +1561,7 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, #if defined (HAVE_prologue) if (dwarf2out_do_frame ()) - dwarf2out_frame_debug (NULL_RTX, false); + dwarf2out_frame_debug_init (); #endif /* If debugging, assign block numbers to all of the blocks in this -- 2.30.2