From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AA66D38418B5; Sat, 25 Jun 2022 02:51:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA66D38418B5 From: "ulrich.weigand at de dot ibm.com" To: gdb-prs@sourceware.org Subject: [Bug tdep/29247] [gdb, tdep] ../../gdb/ppc-sysv-tdep.c:1945: internal-error: ppc64_sysv_abi_return_value: Assertion `ok' failed Date: Sat, 25 Jun 2022 02:51:16 +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: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ulrich.weigand at de dot ibm.com 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: 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2022 02:51:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29247 --- Comment #17 from ulrich.weigand at de dot ibm.com --- (In reply to Carl E Love from comment #16) > Created attachment 14167 [details] > + /* IBM long double uses floating point registers for the 128-bit value= .=20 > */ > + if ((type->code () =3D=3D TYPE_CODE_FLT > + && !(gdbarch_long_double_format (gdbarch) This ^ > + =3D=3D floatformats_ieee_quad) && TYPE_LENGTH (type) =3D=3D 16) ends here ^ > || type->code () =3D=3D TYPE_CODE_DECFLOAT) making the whole thing equivalent to if ((type->code () =3D=3D TYPE_CODE_FLT && gdbarch_long_double_format (gdbarch) !=3D floatformats_ieee_quad && TYPE_LENGTH (type) =3D=3D 16) || type->code () =3D=3D TYPE_CODE_DECFLOAT) so it will no longer be used at all for binary floating-point types of leng= ths other than 16 bytes. > I was trying to make sure that the IEEE 128-bit case would be excluded. I > think it was only taking that one case out. No, it wasn't. > But, it is hard to read. I > rewrote it to make it easier to read. By checking for the IEEE FLOAT > 128-bit case first, then TYPE_CODE_FLT you don't need to modify the exist= ing > "if (type->code () =3D=3D TYPE_CODE_FLT" statement. Sure. It seems to me that these changes, in combination with the homogeneo= us struct changes below, are quite complicated and introduce a lot of code duplication. Maybe it would be preferable to handle this case just once, = *in* ppc64_sysv_abi_push_freg, instead of updating all its callers. > I also found I had missed handling a float case. I fixed that it reduced > the number of errors from 72 to 12. I am not sure about the check for > aggregate candidate and homogeneous aggregate. Not sure yet what a > homogeneous float/vector is and if I need to do something special to check > for them in the case of the IEEE FLOAT 128-bit case? Homogeneous structs are structures where all elements have the same type, a= nd that same type is a float or vector type. Those structs are passed as if t= he members were passed on their own. E.g. an element of type struct { long double x; long double y; } is passed exactly as if it were two arguments of "long double" type each.=20 Therefore, this also does have to take IEEE vs. IBM float 128-bit into acco= unt. The ELFv1 ABI did not support that generic homogenous struct case, but still handled *single-element* structures likewise. > Attached latest patch. It has a comments indicating the new code. There are more problems with wrong grouping, this time with '{' nesting in = the code added to ppc_sysv_abi_push_dummy_call. Just copy (or even better, restructure the if clauses to re-use) the vector case. --=20 You are receiving this mail because: You are on the CC list for the bug.=