c++: Change mangling of Intel/Motorola extended long double literals
On Fri, Sep 05, 2025 at 09:57:06PM +0200, Matthias Kretz wrote:
> > Hmm, would this fail for x86 long double, which is 80 bits? OK, just
> > checked. It's mangled as 12/16 bytes on i686/x86_64.
>
> It seems that Clang and GCC disagree on mangling 80-Bit long double:
>
> I like Clang's interpretation of https://itanium-cxx-abi.github.io/cxx-abi/
> abi.html#mangle.float better.
This patch changes the mangling of 80-bit long double literals from
24 or 32 digits (on m68k with padding bits in the middle, on x86
at the start) to just 20 hex digits.
2025-09-10 Jakub Jelinek <jakub@redhat.com>
* mangle.cc (write_real_cst): Mangle Intel/Motorola extended
80-bit formats using 20 hex digits instead of 24 or 32.
* g++.target/i386/mangle-ldbl-1.C: New test.
* g++.target/i386/mangle-ldbl-2.C: New test.
* g++.target/m68k/mangle-ldbl-1.C: New test.
* g++.target/m68k/mangle-ldbl-2.C: New test.