public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "assaiante at diag dot uniroma1.it" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/104549] Missing variable at O2/O3 likely caused by -fearly-inlining
Date: Thu, 17 Feb 2022 12:38:54 +0000	[thread overview]
Message-ID: <bug-104549-4-DWVFwys1C8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104549-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Cristian Assaiante <assaiante at diag dot uniroma1.it> ---
I have tested multiple older gcc versions (4.3, 7.5, 9.4, 11.2) and apparently
the variable is visible in 4.3 and 7.5. 
The asm for the main function of the binary from gcc7.5:
main:
.LFB1:
        # a.c:9
        .loc 1 9 0
        .cfi_startproc
# BLOCK 2 freq:10000 seq:0
# PRED: ENTRY [100.0%]  (FALLTHRU)
.LVL2:
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
.LBB4:
.LBB5:
        # a.c:5
        .loc 1 5 0
        xorl    %edi, %edi
        xorl    %eax, %eax
        call    test@PLT
.LVL3:
.LBE5:
.LBE4:
        # a.c:11
        .loc 1 11 0
        xorl    %eax, %eax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
# SUCC: EXIT [100.0%] 
        ret

Differently from more recent versions, the inlined a is in the LBB5...LBE5
range only. So there is no empty range associated to it and the debug info in
correctly visualized in gdb.

  parent reply	other threads:[~2022-02-17 12:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 15:46 [Bug debug/104549] New: " assaiante at diag dot uniroma1.it
2022-02-15 17:30 ` [Bug debug/104549] " jakub at gcc dot gnu.org
2022-02-16 13:01 ` jakub at gcc dot gnu.org
2022-02-17 12:38 ` assaiante at diag dot uniroma1.it [this message]
2022-02-17 13:48 ` assaiante at diag dot uniroma1.it

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-104549-4-DWVFwys1C8@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).