From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D8F2E3858431; Thu, 17 Feb 2022 12:38:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8F2E3858431 From: "assaiante at diag dot uniroma1.it" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: assaiante at diag dot uniroma1.it X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2022 12:38:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104549 --- Comment #3 from Cristian Assaiante = --- I have tested multiple older gcc versions (4.3, 7.5, 9.4, 11.2) and apparen= tly the variable is visible in 4.3 and 7.5.=20 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%]=20 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.=