From patchwork Thu Nov 10 20:22:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 124999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 84D4CB6F97 for ; Fri, 11 Nov 2011 07:23:24 +1100 (EST) Received: (qmail 29227 invoked by alias); 10 Nov 2011 20:23:21 -0000 Received: (qmail 29194 invoked by uid 22791); 10 Nov 2011 20:23:12 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_GD, TW_TM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Nov 2011 20:22:59 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAAKMxdC009406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2011 15:22:59 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAAKMxUL027983; Thu, 10 Nov 2011 15:22:59 -0500 Received: from [0.0.0.0] (ovpn-113-127.phx2.redhat.com [10.3.113.127]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pAAKMvmR016428; Thu, 10 Nov 2011 15:22:58 -0500 Message-ID: <4EBC32A0.1060502@redhat.com> Date: Thu, 10 Nov 2011 15:22:56 -0500 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Roberto Agostino Vitillo CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] PR debug/50983 References: <06E1A8DB-DA10-4241-BF88-0C816860D464@gmail.com> In-Reply-To: <06E1A8DB-DA10-4241-BF88-0C816860D464@gmail.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Thanks. I reformatted the patch a bit and added a testcase; here's what I'm checking in. commit 91eed4ebec24bbb2993c1ca8a5407f4fdeff48ec Author: Jason Merrill 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. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 39be9a1..7b5930e 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/gcc.dg/debug/dwarf2/asm-line1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c new file mode 100644 index 0000000..1d2e148 --- /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; +}