delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/23/11:47:26

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Compile extensions
Date: Sun, 19 Jan 1997 11:48:24 +0000
Organization: None
Lines: 25
Distribution: world
Message-ID: <3+nuYOAIog4yEw0o@talula.demon.co.uk>
References: <01bc03eb$6be81120$492449c2 AT default>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Thomas Harte writes:
>       Which extensions to the regular GCC command line do you all 
>recommend to use when compiling for speed over size.

-m486, unless your target machine is a 386. The code produced with this
option can still run on a 386, but will be optimised for a 486.

-O2 or -O3. Which is better depends on your program. O3 does things like
automatically inlining functions and expanding loops, which can hugely
bloat your executable size. They may help performance, but in some
situations can actually hinder it, due to reduced cache performance.
Profile them and see which works best...

-ffast-math. Improves floating point efficiency, allowing gcc to violate
some details of the ANSI spec and fail to handle some error conditions
correctly.

-fomit-frame-pointer. Lets gcc use the frame pointer (ebp) as an extra
general-purpose register. You won't be able to debug or profile anything
compiled with this option.

/*
 *  Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
 *  Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
 */

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019