OSDN Git Service

PR debug/50983
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Nov 2011 20:28:04 +0000 (20:28 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Nov 2011 20:28:04 +0000 (20:28 +0000)
* dwarf2out.c (set_cur_line_info_table): Restore the last is_stmt
value in the current line table.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181269 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 92cb202..9c7a2f8 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-10  Roberto Agostino Vitillo  <ravitillo@lbl.gov>
+
+       PR debug/50983
+       * dwarf2out.c (set_cur_line_info_table): Restore the last is_stmt
+       value in the current line table.
+
 2011-11-10  Nathan Sidwell  <nathan@acm.org>
 
        * gcov.c (struct function_info): Make src an index, not a pointer.
index 39be9a1..7b5930e 100644 (file)
@@ -20371,6 +20371,10 @@ set_cur_line_info_table (section *sec)
       VEC_safe_push (dw_line_info_table_p, gc, separate_line_info, table);
     }
 
+  if (DWARF2_ASM_LINE_DEBUG_INFO)
+    table->is_stmt = (cur_line_info_table
+                     ? cur_line_info_table->is_stmt
+                     : DWARF_LINE_DEFAULT_IS_STMT_START);
   cur_line_info_table = table;
 }
 
index e988797..f3315cb 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-10  Jason Merrill  <jason@redhat.com>
+
+       PR debug/50983
+       * gcc.dg/debug/dwarf2/asm-line1.c: New.
+
 2011-11-10  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/atomic6_1.adb: New test.
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c
new file mode 100644 (file)
index 0000000..1d2e148
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR debug/50983 */
+/* { dg-do compile { target *-*-linux-gnu } } */
+/* { dg-options "-O0 -gdwarf-2" } */
+/* { dg-final { scan-assembler "is_stmt 1" } } */
+
+int i;
+void f() __attribute ((section ("foo")));
+void f() { if (i) ++i; else --i; }
+
+void fun()
+{
+  return;
+}
+
+int main()
+{
+  f();
+  fun();
+  return 0;
+}