public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* mangling of real-valued template parameters: inherent ABI instability  and cross-compiling nightmare
@ 2003-06-03 21:01 Joern Rennecke
  2003-06-20  1:16 ` Mark Mitchell
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Rennecke @ 2003-06-03 21:01 UTC (permalink / raw)
  To: gcc

When not cross-compiling, cp/mangle.c:write_template_arg_literal
dumps out the bit pattern inside a TREE_REAL_CST in hex - when
cross-compiling, it give a message:
"sorry, unimplemented: real-valued template parameters when cross-compiling"
(which can be observed for the testcase g++.dg/abi/mangle17.C) .
A TREE_REAL_CST is currently implemented as a struct real_value.
Not only does the layout depend on ABI details of the host -
and you will get different mangling you you compile the compiler
binary with a different ABI, which can be quite 'interesting' on
hosts that have more than one, e.g. x86-64 - but the exact value
of the mangled name also depends on what the compiler the compiler
was compiled with deems to stuff into the holes between the structure
members.  We make no guarantees that we don't change these gap fillers -
they might even change during the runtime of a program - and neither
do other compiler providers.
Also, 'fixing' the cross-compiling case to output the name as if it
was mangled by a native compiler on the target is just too messy to
contemplate.

I move that we break compatibility once now, to a proper mangling
that depends only on the value, but not on the ABI.
real.c:real_to_hexadecimal seems a good start, then probably replace
the decimal point and the signs with other characters, e.g.:
'.' -> 'p'
'-' -> 'M'
'+' -> 'P'
plus do whatever is needed so that the mangling won't be confused
with another one.
	
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mangling of real-valued template parameters: inherent ABI instability  and cross-compiling nightmare
  2003-06-03 21:01 mangling of real-valued template parameters: inherent ABI instability and cross-compiling nightmare Joern Rennecke
@ 2003-06-20  1:16 ` Mark Mitchell
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Mitchell @ 2003-06-20  1:16 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: gcc

On Tue, 2003-06-03 at 13:33, Joern Rennecke wrote:
> When not cross-compiling, cp/mangle.c:write_template_arg_literal
> dumps out the bit pattern inside a TREE_REAL_CST in hex - when
> cross-compiling, it give a message:

FYI, Zack checked in a patch for this on June 9th.

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-20  0:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-03 21:01 mangling of real-valued template parameters: inherent ABI instability and cross-compiling nightmare Joern Rennecke
2003-06-20  1:16 ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).