public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: -fno-rtti
       [not found] <20000313103358.C25605@neel>
@ 2000-03-13 11:20 ` llewelly
  2000-04-01  0:00   ` -fno-rtti llewelly
  0 siblings, 1 reply; 2+ messages in thread
From: llewelly @ 2000-03-13 11:20 UTC (permalink / raw)
  To: Neelakanth Nadgir; +Cc: gcc-help

On Mon, 13 Mar 2000, Neelakanth Nadgir wrote:

> 
>  Hi,
>  a quick question,

I believe gcc@gcc.gnu.org is for gcc developer
  concerns; gcc-help@gcc.gnu.org is more apropriate for this question.

>  If a code uses RTTI, can it be compiled with -fno-rtti ?

No. RTTI  requires type_info nodes, which it uses to identify types at
  runtime. For example, dynamic_cast<> works by comparing type_info nodes.

If you compile code which uses dynamic_cast<> or typeid with -fno-rtti,
  g++ will generate an error.

> 
> Why is it that for some codes -fno-rtti decreases codesize by as
> much as 5x?

Every type in a C++ program needs a type_info node. C++ programs often
  contain many, many types. Thus the size increase.

However, in my experience, I do not think I have ever seen 5x
  increase; 15-30% (1.15x to 1.3x) is more common.

[snip]

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

* Re: -fno-rtti
  2000-03-13 11:20 ` -fno-rtti llewelly
@ 2000-04-01  0:00   ` llewelly
  0 siblings, 0 replies; 2+ messages in thread
From: llewelly @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Neelakanth Nadgir; +Cc: gcc-help

On Mon, 13 Mar 2000, Neelakanth Nadgir wrote:

> 
>  Hi,
>  a quick question,

I believe gcc@gcc.gnu.org is for gcc developer
  concerns; gcc-help@gcc.gnu.org is more apropriate for this question.

>  If a code uses RTTI, can it be compiled with -fno-rtti ?

No. RTTI  requires type_info nodes, which it uses to identify types at
  runtime. For example, dynamic_cast<> works by comparing type_info nodes.

If you compile code which uses dynamic_cast<> or typeid with -fno-rtti,
  g++ will generate an error.

> 
> Why is it that for some codes -fno-rtti decreases codesize by as
> much as 5x?

Every type in a C++ program needs a type_info node. C++ programs often
  contain many, many types. Thus the size increase.

However, in my experience, I do not think I have ever seen 5x
  increase; 15-30% (1.15x to 1.3x) is more common.

[snip]

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

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20000313103358.C25605@neel>
2000-03-13 11:20 ` -fno-rtti llewelly
2000-04-01  0:00   ` -fno-rtti llewelly

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