[llvm-dev] cxa_demangle for long double / float80

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 18 05:40:16 PDT 2015


Hey,

I'm hitting another issue on libcxxabi:

libcxxabi :: test_demangle:

_ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c should be invalid
but is not
 got status = 0
test_demangle.pass.cpp.exe:
/home/rengolin/devel/buildslave/clang-cmake-aarch64-prototype/libcxxabi/test/test_demangle.pass.cpp:29655:
void test2(): Assertion `status == -2' failed.

AFAICS, "e" is either "long double" or, on Intel, "float80", so that
string should not be invalid on any architecture.

I try that on c++filt on ARM and AArch64 and both returned the
"correct" demangling:

void test0::h<float>(char (&) [(unsigned int)((sizeof (float))+((long
double)[4001a000000000000000]))])

Also, looking at libcxxabi::parse_builtin_type, there is no
distinction between long double and float80 in the switch, hinting me
that this macro is wrong:

// Is long double fp80?  (Only x87 extended double has 64-bit mantissa)
#define LDBL_FP80 (__LDBL_MANT_DIG__ == 64)
...
#if !LDBL_FP80
    "_ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c",
#endif

is wrong.

If this was turned on because of x86 32-bits, shouldn't we restrict
that to x86 only? Instead of any 64-bit architecture?

Or am I missing something?

cheers,
--renato


More information about the llvm-dev mailing list