From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22292385842D; Wed, 16 Feb 2022 13:01:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22292385842D From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/104549] Missing variable at O2/O3 likely caused by -fearly-inlining Date: Wed, 16 Feb 2022 13:01:11 +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: jakub at gcc dot gnu.org 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: cc 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: Wed, 16 Feb 2022 13:01:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104549 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aoliva at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- The assembly of main is: main: .LFB1: # pr104549.c:9:1 .loc 1 9 1 .cfi_startproc # BLOCK 2, count:1073741824 (estimated locally) seq:0 # PRED: ENTRY [always] count:1073741824 (estimated locally) (FALLTHRU) # pr104549.c:10:5 .loc 1 10 5 .LBB4: .LBB5: # pr104549.c:3:5 .loc 1 3 5 .LVL2: # DEBUG i =3D> 0 # pr104549.c:4:5 .loc 1 4 5 # pr104549.c:4:19 .loc 1 4 19 # pr104549.c:4:12 .loc 1 4 12 # pr104549.c:5:5 .loc 1 5 5 .LBE5: .LBE4: # pr104549.c:9:1 .loc 1 9 1 is_stmt 0 subq $8, %rsp .cfi_def_cfa_offset 16 .LBB7: .LBB6: # pr104549.c:5:5 .loc 1 5 5 xorl %edi, %edi xorl %eax, %eax call test .LVL3: .LBE6: .LBE7: # pr104549.c:11:1 .loc 1 11 1 xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 # SUCC: EXIT [always] count:1073741824 (estimated locally) ret with -O2 -g -dA, the inlined a is in the .LBB4...LBE4 and .LBB7...LBE7 rang= es but the first range is empty (no insns in it), the very first insn in main doesn't belong to the inline function and .loc for = it is line 9, perhaps the debugger chooses some other one because of the is_st= mt 0? With -gno-statement-frontiers the debugger reports main's { as the first location.=