From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 859243857829; Fri, 30 Jul 2021 02:21:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 859243857829 From: "guojiufu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/101669] error reading variable from debug information when compiling with -O2 Date: Fri, 30 Jul 2021 02:21:47 +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.1.1 X-Bugzilla-Keywords: wrong-debug X-Bugzilla-Severity: minor X-Bugzilla-Who: guojiufu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Fri, 30 Jul 2021 02:21:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101669 --- Comment #5 from Jiu Fu Guo --- (In reply to Andrew Pinski from comment #4) > What version of gdb are you using? Tried gdb8.1/8.3/9.2 on ppc64le. In gdb, the msg "error reading variable: dwarf2_find_location_expression:" occurs when stopping at the breakpoint 'sub' on the tip message: ------------ Breakpoint 1, 0x0000000100000a58 in sub (a=3D, n=3D10) at /home/guojiufu/temp/gdb.f90:7 ------------ readelf --debug-dump arg1.exe |grep readelf readelf: Error: Invalid location list entry type 8 readelf: Warning: Hole and overlap detection requires adjacent view lists a= nd loclists. -------- readelf -v GNU readelf (GNU Binutils for Ubuntu) 2.34 readelf 2.30 can also get the Error/Warning msg. gfortran -O2 -g ~/temp/gdb.f90 -gdwarf-5 -o arg1.exe On x86 is similar, readelf2.30/gdb8.1 can reproduce the msg at my side. Before gcc11, need -gdwarf-5 to reproduce since we default to this dwarf version in gcc11.=