This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: a question about -O5
- To: IGOR LEONIDOVICH MARKOV <imarkov at ucla dot edu>
- Subject: Re: a question about -O5
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 02 Jul 1999 04:14:21 -0600
- cc: egcs at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <Pine.SOL.4.05.9907020222400.1280-100000@margay.noc.ucla.edu>you w
rite:
> egcs-1.1.2 CC4.2
>
> Prog 1 no optimization 8350K 9570K
> Prog 2 no optimization 3700K 3890K
> Prog 1 -O5 2560K 4210K
> Prog 2 -O5 70K 30K
>
> I understand why Prog 2 -O5 is so far ahead (cause
> it has no sqrt call and the loop contents can be optimized out),
> but I don't understand why this is the only test where CC wins..
Probably library overhead still. Some stuff from libgcc.a is always going
to be included.
When you get down to a small enough size, the library overhead will turn out
to be nontrivial compared to the main program. However the libgcc code is not
critical path code, so if your concern is really performance this would be a
nonissue (and in which case it doesn't make sense to compare sizes anyway).
Also note that even if gcc uses the sqrt instruction it will emit checks to
verify the domain is correct and if it is not it will call the system sqrt
(this is to be strictly ANSI/ISO/IEEE conforming, see matherr and sqrt in
the appropriate standards).
You also do not mention what those numbers really mean. Are those the size of
of the text segments, the entire file, what?
jeff