This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ vs. C asm/object file size
- To: Joe Buck <jbuck at Synopsys dot COM>, egcs at cygnus dot com
- Subject: Re: C++ vs. C asm/object file size
- From: Benjamin Scherrey <scherrey at gte dot net>
- Date: Mon, 11 Jan 1999 21:05:44 -0500
- Organization: Proteus Technologies, Inc.
- References: <199901111759.JAA24362@atrus.synopsys.com>
- Reply-To: scherrey at proteus-tech dot com
Joe Buck wrote:
> Theoretically you will get the same object code from the same source code
> (if your input language is in the common C/C++ subset), because C++ and C
> are both converting to the same intermediate form and using the same
> backend (provided that you disable exceptions).
>
> In practice, you may find some differences. If you do, it would be useful
> to figure out why, so that we can get better code. I recall that in the
> past, there were some optimizations that didn't occur in the C++ front end
> but did in the C front end, but this was unintentional and could be fixed.
OK - looks like my problem (seeing identical .s output but different .o
results) was a fluke or mistake on my part. I now have it turn off rtti and
exception handling for the C++ build and the only difference is the size of the
symbol names due to name mangling. using -fnew-abi reduces the size differences
again. Otherwise it appears that the asm output is identical (which is good).
Now I need to start extern "C"'ing the header files and I should end up with
identical asms and object files. If I do spot a difference then I'll let the
list know.
later,
Ben Scherrey