From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC53A3858434; Mon, 21 Nov 2022 12:49:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC53A3858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669034959; bh=Yu4Ww5vlHOpwx0Q//fQMEvYHNcxtM1czlhArpE2law0=; h=From:To:Subject:Date:From; b=OxE3RD2zv2maHNJN3waIbrSOmHLkkK1gNOfZM1ClOKXTx9aIlII0RkjdWIUcqR9vo k5MIS3kNE+vXIUG8JUqVALHlQS8rE2rF26BQmyWHlM7HHG6ER3ZAuWtd4a+1D995rU Hk7YQHsnUlWLT05yueaX/F93F5y3uoIKTv8PzF1U= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/29813] New: [gdb/testsuite, powerpc64le] FAIL: gdb.base/vla-optimized-out.exp: o1: printed size of optimized out vla Date: Mon, 21 Nov 2022 12:49:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29813 Bug ID: 29813 Summary: [gdb/testsuite, powerpc64le] FAIL: gdb.base/vla-optimized-out.exp: o1: printed size of optimized out vla Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: testsuite Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- On powerpc64le, with gcc 7.5.0, I run into: ... (gdb) PASS: gdb.base/vla-optimized-out.exp: o1: printed optimized out vla p sizeof (a)^M $2 =3D ^M (gdb) FAIL: gdb.base/vla-optimized-out.exp: o1: printed size of optimized o= ut vla ... The dwarf expression that needs evaluating is: ... <155> DW_AT_upper_bound : 13 byte block: f3 1 53 23 1 8 20 24 8 20 26= 31 1c (DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)); DW_OP_plus_uconst: 1; DW_OP_const1u: 32; DW_OP_shl; DW_OP_const1u: 32; DW_OP_shra; DW_OP_lit1; DW_OP_minus) ... I suppose the following happens. The DW_OP_GNU_entry_value needs to be evaluated, and gdb looks for a call site matching this pc: ... (gdb) up #1 0x0000000010000690 in main () at gdb/testsuite/gdb.base/vla-optimized-out.c:42 42 j =3D f1 (i); (gdb) ... There is a call site here: ... <2>: Abbrev Number: 5 (DW_TAG_GNU_call_site) DW_AT_low_pc : 0x10000694 DW_AT_abstract_origin: <0x110> ... which is not matched because it's 0x4 off. Looking at the .s file: ... bl f1 # 11 *call_value_nonlocal_aixdi [length =3D 8] nop .LVL4: ... it becomes clear what happened. The pc label for the call site: ... .uleb128 0x5 # (DIE (0x67) DW_TAG_GNU_call_site) .8byte .LVL4 # DW_AT_low_pc .4byte 0x81 # DW_AT_abstract_origin .byte 0 # end of children of DIE 0x2d ... comes after the nop, and it should come before. FWIW, in principle, gdb could do better, because it could look at the pc: ... (gdb) p /x $pc $1 =3D 0x1000065c ... and conclude that it's the start of the function: ... (gdb) disassemble f1 Dump of assembler code for function f1: =3D> 0x000000001000065c <+0>: li r3,5 0x0000000010000660 <+4>: blr 0x0000000010000664 <+8>: .long 0x0 0x0000000010000668 <+12>: .long 0x0 0x000000001000066c <+16>: .long 0x0 End of assembler dump. ... and therefore DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)) =3D=3D DW_OP_reg3: ... (gdb) p $r3 $2 =3D 5 ... which indeed has the correct value. --=20 You are receiving this mail because: You are on the CC list for the bug.=