re PR debug/41695 (Invalid .debug_loc created)
authorJakub Jelinek <jakub@gcc.gnu.org>
Wed, 14 Oct 2009 09:53:55 +0000 (11:53 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 14 Oct 2009 09:53:55 +0000 (11:53 +0200)
PR debug/41695
* dwarf2out.c (dwarf2out_var_location): Always clear
last_postcall_label when changing last_label.

* gcc.dg/debug/dwarf2/pr41695.c: New test.

From-SVN: r152760

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c [new file with mode: 0644]

index bbb97ec6c9c738635bf924711dd568f64484ef76..992f9b647c061ab0ec3a5a3a8fe8a1a926c889d7 100644 (file)
@@ -1,3 +1,9 @@
+2009-10-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/41695
+       * dwarf2out.c (dwarf2out_var_location): Always clear
+       last_postcall_label when changing last_label.
+
 2009-10-14  Pascal Obry  <obry@adacore.com>
 
        * gcc.c (DEFAULT_SWITCH_CURTAILS_COMPILATION): Add -E.
index 1e47e7a17042c3b4cf1995b3455ac306eb939080..2f9d2b8337b8a5cfa67ff06fbb1e7cc4192ce9e4 100644 (file)
@@ -20013,8 +20013,7 @@ dwarf2out_var_location (rtx loc_note)
       ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LVL", loclabel_num);
       loclabel_num++;
       last_label = ggc_strdup (loclabel);
-      if (!NOTE_DURING_CALL_P (loc_note))
-       last_postcall_label = NULL;
+      last_postcall_label = NULL;
     }
   newloc->var_loc_note = loc_note;
   newloc->next = NULL;
index 3faf8f2544eb8de52bfdffffc11bc2cc2a35ec74..c93c579c5c8a8efb2055c02d47f56209487e72a5 100644 (file)
@@ -1,8 +1,13 @@
+2009-10-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/41695
+       * gcc.dg/debug/dwarf2/pr41695.c: New test.
+
 2009-10-14  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc.target/i386/i386.exp (check_effective_target_ms_hook_prologue):
        New procedure.
-       * gcc.target/i386/ms_hook_prologue.c: Check for  ms_hook_prologue
+       * gcc.target/i386/ms_hook_prologue.c: Check for ms_hook_prologue
        effective target.
 
 2009-10-14  Jason Merrill  <jason@redhat.com>
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
new file mode 100644 (file)
index 0000000..d61b5a2
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR debug/41695 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -dA -fno-merge-debug-strings" } */
+
+int bar (int);
+
+void
+foo (void)
+{
+  int b = 0;
+  b = bar (b);
+  b = bar (b);
+  b = bar (b);
+  b = bar (b);
+  bar (b);
+}
+
+/* { dg-final { scan-assembler-not "LVL(\[0-9\]+)-\[^1\]\[^\\r\\n\]*Location list begin address\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*LVL\\1-1-" } } */