public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* typeinfo problem (bug?)
@ 2006-11-24 19:01 John (Eljay) Love-Jensen
  2006-11-27 10:07 ` Nathan Sidwell
  0 siblings, 1 reply; 3+ messages in thread
From: John (Eljay) Love-Jensen @ 2006-11-24 19:01 UTC (permalink / raw)
  To: MSX to GCC

Hi everyone,

I've run into a problem with std::type_info.

It appears that hidden visibility can cause multiple instances of a type_info object for one type, hence RTTI information is not being merged across SSO and DSO boundaries.  :-(

Is there an appropriate flag to specify to the compiler that will cause __GXX_MERGED_TYPEINFO_NAMES to be defined as 1?

I supposed I can just -D__GXX_MERGED_TYPEINFO_NAMES ... but I was under the impression that the __GXX_WHATEVER preprocessor defines shouldn't be twiddled by hand.

Perhaps I'm mistaken about refraining from specifying -D__GXX_WHATEVER on the g++ command line?

- - - - - - - - - - - - - - - - - - - - -

Also (incidentally & unrelated to the above), it is very weird that __GXX_MERGED_TYPEINFO_NAMES has two different semantics.  Specifying __GXX_MERGED_TYPEINFO_NAMES has two unrelated orthogonal effects:
1. are the before() and operator==() routines inline or function calls
2. are the before() and operator==() routines lightweight pointer compares or slightly more costly string compares

I'd like to have inline routines using __builtin_strcmp.  But I can imagine some situations where __builtin_strcmp is desired, but only as function calls and not inline.

Unfortunately...
__GXX_MERGED_TYPEINFO_NAMES == 0 means "strcmp & function calls".
__GXX_MERGED_TYPEINFO_NAMES == 1 means "pointer compares & inline".

There's no "strcmp & inline" (what I want), nor is there "pointer compares & function calls".  Hmmmm.

I'm using GCC 4.0.1, so perhaps this has been fixed by now.

Sincerely,
--Eljay

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

* Re: typeinfo problem (bug?)
  2006-11-24 19:01 typeinfo problem (bug?) John (Eljay) Love-Jensen
@ 2006-11-27 10:07 ` Nathan Sidwell
  2006-11-27 13:05   ` John Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Sidwell @ 2006-11-27 10:07 UTC (permalink / raw)
  To: John (Eljay) Love-Jensen; +Cc: MSX to GCC

John (Eljay) Love-Jensen wrote:
> Hi everyone,
> 
> I've run into a problem with std::type_info.
> 
> It appears that hidden visibility can cause multiple instances of a type_info object for one type, hence RTTI information is not being merged across SSO and DSO boundaries.  :-(

Example?  At first blush it might be the exact intended behaviour.  If you've 
made a type hidden, why would you expect it to be visible?

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

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

* Re: typeinfo problem (bug?)
  2006-11-27 10:07 ` Nathan Sidwell
@ 2006-11-27 13:05   ` John Love-Jensen
  0 siblings, 0 replies; 3+ messages in thread
From: John Love-Jensen @ 2006-11-27 13:05 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: MSX to GCC

Hi Nathan,

> Example?  At first blush it might be the exact intended behaviour.  If you've
> made a type hidden, why would you expect it to be visible?

If I could specify visibility hidden except for type_info (without knowing
/a priori/ the symbols), I would.

Sincerely,
--Eljay

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

end of thread, other threads:[~2006-11-27 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-24 19:01 typeinfo problem (bug?) John (Eljay) Love-Jensen
2006-11-27 10:07 ` Nathan Sidwell
2006-11-27 13:05   ` John Love-Jensen

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).