From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16977 invoked by alias); 28 Oct 2011 21:00:25 -0000 Received: (qmail 16964 invoked by uid 22791); 28 Oct 2011 21:00:24 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 21:00:07 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RJtX2-00051o-5m for gdb-patches@sources.redhat.com; Fri, 28 Oct 2011 23:00:04 +0200 Received: from 209.226.137.108 ([209.226.137.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Oct 2011 23:00:04 +0200 Received: from aristovski by 209.226.137.108 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Oct 2011 23:00:04 +0200 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: [patch] Workaround gcc bug 49906 Date: Fri, 28 Oct 2011 21:23:00 -0000 Message-ID: <4EAB17C4.6030902@qnx.com> References: <20111028205157.GA18860@host1.jankratochvil.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kratochvil User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <20111028205157.GA18860@host1.jankratochvil.net> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00785.txt.bz2 On 11-10-28 04:51 PM, Jan Kratochvil wrote: > Hello Aleksandar, > > the problem is that for this testcase: > /*1*/ static int i; > /*2*/ static void > /*3*/ f (int q) > /*4*/ { > /*5*/ for (;; i--) > /*6*/ if (i++) > /*7*/ break; > /*8*/ } > /*9*/ int main (void) { f (5); return 0; } > > Built with: > gcc -o f2 f2.c -Wall -g -Werror > gcc (GCC) 4.6.3 20111028 (prerelease) -- the version should not matter > x86_64 > > it has a regression > gdb ./f2 -ex 'b f' -ex r > FSF GDB HEAD: > Breakpoint 1, f (q=5) at f2.c:6 > ^ > 6 if (i++) > with your patch: > Breakpoint 1, f (q=0) at f2.c:4 > ^ > 4 { > I think that if you dump line info for your test you will find that line info is broken as well. Correct line info would yield answer "line 5" after skipping prologue. Your result looks slightly better because you did not put {..} for the 'for' block, but it is not correct. IMO, with the fix, the result is better (beginning of the function block is better IMO than first statement inside 'for' block). > For reader's convenience attaching objdump at the bottom of this mail. Could you do objdump -W and post the output? --- Aleksandar