diff mbox

[1/2] dwarf2cfi: Insert notes correctly wrt tablejumps.

Message ID 1310169106-4376-2-git-send-email-rth@redhat.com
State New
Headers show

Commit Message

Richard Henderson July 8, 2011, 11:51 p.m. UTC
PR bootstrap/49680
        * dwarf2cfi.c (dwarf2out_frame_debug): Insert cfi notes after
        any tablejump vector.
---
 gcc/ChangeLog   |    6 ++++++
 gcc/dwarf2cfi.c |   12 ++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ad8058..3ba9bf7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@ 
+2011-07-08  Richard Henderson  <rth@redhat.com>
+
+	PR bootstrap/49680
+	* dwarf2cfi.c (dwarf2out_frame_debug): Insert cfi notes after
+	any tablejump vector.
+
 2011-07-08  Jakub Jelinek  <jakub@redhat.com>
 
 	PR target/49621
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 44655bb..8031d48 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -2180,8 +2180,16 @@  dwarf2out_frame_debug (rtx insn, bool after_p)
   bool handled_one = false;
   bool need_flush = false;
 
-  /* Remember where we are to insert notes.  */
-  cfi_insn = (after_p ? insn : PREV_INSN (insn));
+  /* Remember where we are to insert notes.  Do not separate tablejump
+     insns from their ADDR_DIFF_VEC.  Putting the note after the VEC
+     should be ok.  */
+  if (after_p)
+    {
+      if (!tablejump_p (insn, NULL, &cfi_insn))
+	cfi_insn = insn;
+    }
+  else
+    cfi_insn = PREV_INSN (insn);
 
   if (!NONJUMP_INSN_P (insn) || clobbers_queued_reg_save (insn))
     dwarf2out_flush_queued_reg_saves ();