From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 888863857027; Tue, 16 Nov 2021 14:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 888863857027 From: "wcohen at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/103241] Odd 0 length entries in location lists Date: Tue, 16 Nov 2021 14:46:57 +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: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcohen at redhat dot com 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: Tue, 16 Nov 2021 14:46:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103241 --- Comment #2 from Will Cohen --- Yes, the kernel vmlinux is too large and isn't a great reproducer for this. Need a much smaller example. Trying to compile just the linux/arch/x86/mm/pat/set_memory.c with -save-temps to provide a better vie= w of what GCC is doing. From the output of llvm-dwarfdump there seems to be two flavors of 0-length location list entries: -At the very beginning of the function "start" has "[0xffffffff8107a540, 0xffffffff8107a540): DW_OP_reg5 RDI" followed by "[0xffffffff8107a540, 0xffffffff8107a569): DW_OP_reg5 RDI, DW_OP_piece 0x8" -The function is has two regions: [0xffffffff8107a540, 0xffffffff8107a6cb) [0xffffffff81bc6967, 0xffffffff81bc6a24)) A number of the arguments have 0-length location lists of the form (for "start"): [0xffffffff8107a6cb, 0xffffffff8107a6cb): DW_OP_reg4 RSI Removed the arch/x86/mm/pat/set_memory.o file from kernel build, did a "make V=3D1 > problems". Extracted the command line and added a -save-temps: gcc -save-temps -Wp,-MMD,arch/x86/mm/pat/.set_memory.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/u= api -I./include/generated/uapi -include ./include/linux/compiler-version.h -inc= lude ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=3D./=3D -Wall -Wundef -Werror=3Dstrict-prot= otypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int -Werror=3Dre= turn-type -Wno-format-security -std=3Dgnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -m= no-avx -fcf-protection=3Dnone -m64 -falign-jumps=3D1 -falign-loops=3D1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3D3 -mskip-rax-setup -mtune= =3Dgeneric -mno-red-zone -mcmodel=3Dkernel -Wno-sign-compare -fno-asynchronous-unwind-= tables -mindirect-branch=3Dthunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=3D2048 -fstack-protector -W= error "-Wimplicit-fallthrough=3D5" -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitial= ized -Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=3Ddate-time -Werror=3Dincompatible-pointer-types -Werror=3Ddesignated-init -Wno-packed-not-aligned -g=20=20=20 -DKBUILD_MODFILE=3D'"arch/x86/mm/pat/set_memory"' -DKBUILD_BASENAME=3D'"set_memory"' -DKBUILD_MODNAME=3D'"set_memory"' -D__KBUILD_MODNAME=3Dkmod_set_memory -c -o arch/x86/mm/pat/set_memory.o arch/x86/mm/pat/set_memory.c ; ./tools/objtool/objtool orc generate --no= -fp=20 --retpoline --uaccess arch/x86/mm/pat/set_memory.o The set_memory.s is still pretty large, but shows what the gcc is generating for the debuginfo.=