From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29159 invoked by alias); 24 May 2012 07:03:56 -0000 Received: (qmail 29128 invoked by uid 22791); 24 May 2012 07:03:54 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vb0-f47.google.com (HELO mail-vb0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 May 2012 07:03:41 +0000 Received: by vbbfr13 with SMTP id fr13so6211348vbb.20 for ; Thu, 24 May 2012 00:03:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.36.180 with SMTP id r20mr14542449vdj.15.1337843021059; Thu, 24 May 2012 00:03:41 -0700 (PDT) Received: by 10.52.19.197 with HTTP; Thu, 24 May 2012 00:03:41 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 May 2012 07:03:00 -0000 Message-ID: Subject: Re: Effect of 'register' keyword on debug info From: Rohit Arul Raj To: gcc-help@gcc.gnu.org Cc: Ian Lance Taylor Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg00179.txt.bz2 On Thu, May 24, 2012 at 3:40 AM, Ian Lance Taylor wrote: > Rohit Arul Raj writes: > >> Looking at the debug info and the generated assembly, the values of >> variables 'f1' and 'd1' are stored in the same register. >> Due to this, while debugging, after setting the break point at (A) >> [line no 8], if we print the value of 'f1' i get the wrong value. > > >> Q: Is this the side effect of using 'register' keyword? If 'f1' is >> getting optimized out, shouldn't we get that info while debugging? > > This question as stated is not really appropriate for the mailing list > gcc@gcc.gnu.org, which is for the development of GCC itself. =A0This > question would be appropriate for gcc-help@gcc.gnu.org. =A0Please take any > followups to gcc-help. =A0Thanks. > > This has nothing to do with using the register keyword. > > Yes, you should ideally be told when a value is unavailable. =A0This > specific area of GCC has been much improved since GCC 4.5.2. > Thanks Ian. I tried with gcc v4.6.3 and get the same behavior. Should this be considered as a bug with debug info generation then? > >> Also, using -fvar-tracking, i get this output while debugging the same >> code. > > That looks like better output to me. > > Ian