From c68b1bc7eb13d1db7fc7b61a3601cac9cb75bcbe Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 10 Nov 2011 15:28:04 -0500 Subject: [PATCH] re PR debug/50983 (incorrect DW_LNS_negate_stmt) PR debug/50983 * dwarf2out.c (set_cur_line_info_table): Restore the last is_stmt value in the current line table. From-SVN: r181269 --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c | 20 +++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92cb2022a8c..9c7a2f8ce3a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-11-10 Roberto Agostino Vitillo + + 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 * gcov.c (struct function_info): Make src an index, not a pointer. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 39be9a16e9c..7b5930ef6ea 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e9887972d23..f3315cb84ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-10 Jason Merrill + + PR debug/50983 + * gcc.dg/debug/dwarf2/asm-line1.c: New. + 2011-11-10 Eric Botcazou * 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 index 00000000000..1d2e1481e5a --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c @@ -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; +} -- 2.30.2