From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98D4B385ED71; Wed, 26 Jan 2022 18:43:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98D4B385ED71 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/104194] No way to distinguish IEEE and IBM long double in debug info Date: Wed, 26 Jan 2022 18:43:49 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org 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: Wed, 26 Jan 2022 18:43:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104194 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:866d73019bd4d1804f7e09409322e6605b81780b commit r12-6882-g866d73019bd4d1804f7e09409322e6605b81780b Author: Jakub Jelinek Date: Wed Jan 26 19:42:31 2022 +0100 dwarf2out: For ppc64le IEEE quad long double, emit DW_TAG_typedef to _Float128 [PR104194] On Mon, Jan 24, 2022 at 11:26:27PM +0100, Jakub Jelinek via Gcc-patches wrote: > Yet another short term solution might be not use DW_TAG_base_type > for the IEEE quad long double, but instead pretend it is a DW_TAG_typ= edef > with DW_AT_name "long double" to __float128 DW_TAG_base_type. > I bet gdb would even handle it without any changes, but of course, it would > be larger than the other proposed changes. Here it is implemented. Testcases I've played with are e.g.: __ibm128 a; long double b; _Complex long double c; static __attribute__((noinline)) int foo (long double d) { long double e =3D d + 1.0L; return 0; } int main () { a =3D 1.0; b =3D 2.0; c =3D 5.0 + 6.0i; return foo (7.0L); } and real(kind=3D16) :: a complex(kind=3D16) :: b a =3D 1.0 b =3D 2.0 end Printing the values of the variables works well, p &b or p &c shows pointer to the correct type, just ptype b or ptype c prints _Float128 instead of long double or complex _Float128 instead of complex long double. Even worse in fortran where obviously _Float128 or complex _Float128 aren't valid types, but as GDB knows them by name, it is just ptype that is weird. 2022-01-26 Jakub Jelinek PR debug/104194 * dwarf2out.cc (long_double_as_float128): New function. (modified_type_die): For powerpc64le IEEE 754 quad long double and complex long double emit those as DW_TAG_typedef to _Float128 or complex _Float128 base type.=