public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aoliva at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/46724] [4.6 Regression] Wrong debug info: Invalid variable location
Date: Fri, 17 Dec 2010 06:19:00 -0000	[thread overview]
Message-ID: <bug-46724-4-tM4ojhE6Lz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46724-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46724

--- Comment #6 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-12-17 06:19:30 UTC ---
Created attachment 22792
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22792
Patch I'm testing that fixes the bug

Here's what I meant.  It does fix the bug at hand, and (surprisingly) we don't
end up emitting debug info for the artificial parameter.  Tracking it is enough
to fix the location info for the variable that maps to the result.  It looks
like this:

        .byte   0x8     # uleb128 0x8; (DIE (0x15b) DW_TAG_variable)
        .ascii "a2\0"   # DW_AT_name
        .byte   0x1     # DW_AT_decl_file
(../../gcc/testsuite/gcc.dg/guality/nrv-1.c)
        .byte   0x10    # DW_AT_decl_line
        .4byte  0xf5    # DW_AT_type
        .4byte  .LLST1  # DW_AT_location

.LLST1:
        .8byte  .LVL0   # Location list begin address (*.LLST1)
        .8byte  .LVL1-1 # Location list end address (*.LLST1)
        .2byte  0x2     # Location expression size
        .byte   0x72    # DW_OP_breg2
        .byte   0       # sleb128 0
        .8byte  0       # Location list terminator begin (*.LLST1)
        .8byte  0       # Location list terminator end (*.LLST1)

The range covers the entire function.  I haven't looked into why we don't
reduce the single-entry entire-function location list to a simpler location.


  parent reply	other threads:[~2010-12-17  6:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 14:33 [Bug debug/46724] New: " krebbel at gcc dot gnu.org
2010-11-30 14:37 ` [Bug debug/46724] " krebbel at gcc dot gnu.org
2010-11-30 14:48 ` krebbel at gcc dot gnu.org
2010-12-02  9:51 ` [Bug debug/46724] [4.6 Regression] " krebbel at gcc dot gnu.org
2010-12-02 12:11 ` jakub at gcc dot gnu.org
2010-12-16  5:39 ` aoliva at gcc dot gnu.org
2010-12-17  6:14 ` aoliva at gcc dot gnu.org
2010-12-17  6:19 ` aoliva at gcc dot gnu.org [this message]
2010-12-17  8:55 ` jakub at gcc dot gnu.org
2010-12-17  9:44 ` jakub at gcc dot gnu.org
2010-12-18  8:02 ` aoliva at gcc dot gnu.org
2010-12-18  8:05 ` aoliva at gcc dot gnu.org
2010-12-22  3:49 ` aoliva at gcc dot gnu.org
2010-12-22  3:56 ` aoliva at gcc dot gnu.org
2011-01-19 22:08 ` aoliva at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46724-4-tM4ojhE6Lz@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).