This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add D demangling support to libiberty
- From: Iain Buclaw <ibuclaw at gdcproject dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 14 Oct 2014 18:33:43 +0100
- Subject: Re: [PATCH] Add D demangling support to libiberty
- Authentication-results: sourceware.org; auth=none
- References: <CABOHX+dCTiefjwOTFfTC4Oa90dp7MaYm0M2T0GcByhB6Q7eO9A at mail dot gmail dot com> <CAKOQZ8xDYdUyi2O2a8HEEJki23DkP6ZT5V_s1dPo=qxeGwZVDA at mail dot gmail dot com> <CABOHX+dM9kwjzXoGGowXeKrUsM249ZYEc=TG5+XS1=TdZi32xQ at mail dot gmail dot com> <CABOHX+fo=Ac1tdoOup6VXqrDKK-jhWMisXZmmMqzh=qmCH+1Jg at mail dot gmail dot com> <20141014141244 dot GA17173 at adacore dot com> <CAKOQZ8y6DCBJpjt9WNGfH8_4RjfE7MFZ=kgRO-0OCYRJj+MOCw at mail dot gmail dot com> <CABOHX+fkVx2GEsv7M60SvQszvtx2tJpekwOG0g0Yn7nE_5nw9w at mail dot gmail dot com> <20141014170751 dot GG4805 at adacore dot com>
On 14 October 2014 18:07, Joel Brobecker <brobecker@adacore.com> wrote:
>> I've just seen this, so I'll repeat what I've said in gdb patches too.
>>
>> The call to strtold is only needed to decode templates which have a
>> floating point value encoded inside. This value may or may not have a
>> greater than double precision.
>>
>> Replacing long double with double will be fine with me. I'll accept
>> that I didn't consider legacy in hindsight, and in reality it would be
>> rather rare to stumble upon the need for strtold.
>
> Attached is a patch that switches it to strtod. Do you have any
> test that could quickly verify it? That seems to be the best
> approach, at least short-term. Later on, if we do want to use
> higher precision, we can indeed add strtold in libiberty.
>
See d-demangle-expected in the libiberty testsuite, in particular:
_D8demangle17__T4testVde0A8P6Zv
demangle.test!(42.0000)
_D8demangle16__T4testVdeA8P2Zv
demangle.test!(42.0000)
_D8demangle18__T4testVdeN0A8P6Zv
demangle.test!(-42.0000)
_D8demangle31__T4testVde0F6E978D4FDF3B646P7Zv
demangle.test!(123.456)
I doubt they would need adjusting.
Regards
Iain