public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/100969] Incorrect debug info for struct under O1 optimization
Date: Wed, 09 Jun 2021 06:41:05 +0000	[thread overview]
Message-ID: <bug-100969-4-JdYB0usQfj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100969-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100969

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |wrong-debug
   Last reconfirmed|                            |2021-06-09
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
 <2><85>: Abbrev Number: 6 (DW_TAG_variable)
    <86>   DW_AT_name        : f
    <88>   DW_AT_decl_file   : 1
    <89>   DW_AT_decl_line   : 8
    <8a>   DW_AT_decl_column : 12
    <8b>   DW_AT_type        : <0x2d>
    <8f>   DW_AT_location    : 2 byte block: 91 64      (DW_OP_fbreg: -28)

but

(gdb) disassemble
Dump of assembler code for function main:
   0x0000000000400497 <+0>:     sub    $0x18,%rsp
   0x000000000040049b <+4>:     movl   $0x7,0x4(%rsp)
   0x00000000004004a3 <+12>:    movl   $0x8,0x8(%rsp)
=> 0x00000000004004ab <+20>:    mov    0x4(%rsp),%rdi
   0x00000000004004b0 <+25>:    mov    $0x9,%esi
   0x00000000004004b5 <+30>:    call   0x400496 <not_opt>

you see the var on the frame has not been fully initialized but instead
the full variable is in the call argument registers %rdi and %esi only.

      reply	other threads:[~2021-06-09  6:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:37 [Bug debug/100969] New: " liyd2021 at gmail dot com
2021-06-09  6:41 ` rguenth at gcc dot gnu.org [this message]

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-100969-4-JdYB0usQfj@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).