This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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.


On Tue, Nov 25, 2003 at 03:03:50AM +0100, Carlo Wood wrote:
> On Mon, Nov 24, 2003 at 01:36:53PM -0800, Geoff Keating wrote:
> > That might be reasonable for 'float' and 'double', but 'long double'
> > varies greatly between platforms.
> 
> sizeof(long double) is > 8 I suppose?  In that case it will
> print just the hex value: (double)[3ff999294912bc6120e95828]
> or actually, it currently would fail to demangle it,
> it doesn't support the 'long double' casts in literals.

The more I read this thread, the more it seems that talking about
bitwise target representations for floating-point values is the wrong 
road.  If the only values we are interested in are literals, then we 
only need a representation for those literals that is compatible with 
the linker's character set.  The key is that when a floating-point 
value is a literal, it has a textual representation seen by the 
compiler, and that's the one we're interested in.  There might be 
some value in translating to a canonical format, so that 1e1, 10.0,
and .1e2 end up encoded the same, but that seems optional.
 
If we also choose to represent values encountered as C99 hex sequences,
it suffices to represent that hex value.  If it happens to encode a
value that may be represented more traditionally, that seems harmless.

Nathan Myers
ncm-nospam@cantrip.org


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