This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR libstdc++/13045 / C++ demangler, floating values and function pointer type return type postfix fix.


Paul Koning <pkoning@equallogic.com> writes:

> Ian Lance Taylor <ian@wasabisystems.com> writes:
> 
> | Paul Koning <pkoning@equallogic.com> writes:
> | 
> | > I don't understand this -- code is built for a particular target.
> | > Why can't the demangler interpret floating point stuff according to
> | > what --target is set to?
> | 
> | The demangler has not historically been a target-dependent tool.  Such
> | a change would lead to things like renaming c++filt to TARGET-c++filt.
> 
> When I build and install --target=foo, I get foo-c++filt today.

Wow, you're right.  That comes from a binutils install, not a gcc
install.  Somehow I overlooked that.

> So
> that's not a change.  Now perhaps the current situation is that
> foo-c++filt is no different from bar-c++filt.

Yes, I believe that's true.  In particular, the actual demangling code
is in libiberty, which is not configured for the target.

It's perhaps worth noting that the libiberty demangler currently
follows a much simpler approach than the C++ demangler, which is to
not attempt to interpret floating constants at all.  This is fully
compliant with non-IEEE targets, and produces demanglings like
    void f<1>(A<(1) + (((int)(-((float)3f800000))))>)

> But it seems rather
> ugly to pretend that non-IEEE targets don't exist.  Especially in view
> of the fact that GCC has had a pile of work done to it to improve its
> float handling -- which among other things causes it to handle
> non-IEEE targets right (or at least, much closer to right).  

Well, to do this, we would have to find some target-specific library.
Actually, we would have to invent one, because there is no
target-specific library shared by gcc, gdb, and the binutils.  Then we
would have to move floating point handling into that library.  And I
guess move the demangler in there as well.

Still not a simple change.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]