From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB906385840F; Fri, 2 Sep 2022 15:14:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB906385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662131691; bh=URJ3ZmUc/Egx6eWRS8fuO2QUEpgRYdumYjzn80rqSnM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lo44mPtg5JIplBhYzTk4ZRAt4/xjuePOo9aAvmUiHMk/uOBpEl4Ld/LGedzcPXqXB SN/ibifGV7ONfafK5qG2mUNo2iRHRmgt8XDcOgl1ofSneAwCepOzPRi4GqRXcK9o4I ZJMAo6dgo1JrrVKzJt/gdUAXMDWgewYRuw9MFzYc= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/29543] [gdb/tdep, ppc] inferior call with long double vararg not handled correctly Date: Fri, 02 Sep 2022 15:14:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep 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: cc Message-ID: In-Reply-To: References: 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=3D29543 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ulrich.weigand at de dot i= bm.com, | |uweigand at sourceware dot= org --- Comment #4 from Tom de Vries --- (In reply to Tom de Vries from comment #3) > I simplified the example to strip the _Complex, and I still got the same > problem, so it's really related to "long double". Looking at that variant, I added the following code: ... void __attribute__((noinline)) test2 (void) { do_copy (1, orig); } ... to get an example how code is generated, and compiled it at -O2 (adding noinline attributes for all functions) to make it more readable. I get this: ... 0000000010000210 : 10000210: 02 10 40 3c lis r2,4098 10000214: 00 80 42 38 addi r2,r2,-32768 10000218: a6 02 08 7c mflr r0 1000021c: 00 00 00 60 nop 10000220: 01 00 60 38 li r3,1 10000224: 00 80 22 39 addi r9,r2,-32768 10000228: 00 00 a9 e8 ld r5,0(r9) 1000022c: 08 00 c9 e8 ld r6,8(r9) 10000230: 10 00 01 f8 std r0,16(r1) 10000234: a1 ff 21 f8 stdu r1,-96(r1) 10000238: 81 ff ff 4b bl 100001b8 1000023c: 60 00 21 38 addi r1,r1,96 10000240: 10 00 01 e8 ld r0,16(r1) 10000244: a6 03 08 7c mtlr r0 10000248: 20 00 80 4e blr 1000024c: 00 00 00 00 .long 0x0 10000250: 00 00 00 01 .long 0x1000000 10000254: 80 00 00 00 .long 0x80 10000258: 00 00 00 60 nop 1000025c: 00 00 42 60 ori r2,r2,0 ... AFAICT, the first arg is loaded into r3, and the second into r5/r6. So, for some reason r4 is skipped. However, when stepping through ppc64_sysv_abi_push_val I find that gdb push= es the value to r4/r5. The code in do_copy then proceeds to read it from r5/r= 6, and this explains the failure. --=20 You are receiving this mail because: You are on the CC list for the bug.=