commit 91eed4ebec24bbb2993c1ca8a5407f4fdeff48ec
Author: Jason Merrill <jason@redhat.com>
Date: Thu Nov 10 00:11:13 2011 -0500
PR debug/50983
* dwarf2out.c (set_cur_line_info_table): Restore the last is_stmt
value in the current line table.
@@ -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;
}
new file mode 100644
@@ -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;
+}