Willus.com Home   |   Archive

Willus.com's MinGW/Gnu C Tips

MinGW Tips
Overview
Starter Links
Compile Flags
Fast Math Funcs
DLLs
Globbing
Console
Binary Stdout
Predefined Macros
Show All Tips
 
  Compile Flags
I do a lot of numeric (double precision floating point) programming, and my experience is that the -O3 -ffast-math compile flag combination consistently yields just about the best result. Be warned that -ffast-math takes some math shortcuts and does not follow all IEEE error-handling conventions, so if you use this flag, you should verify your results, especially if you need very high accuracy. My experience is that it is well worth the speed boost to use this flag. I have seen on the MinGW users mail archive that -Os (optimize for small code size) can also yield the best results in some cases, perhaps because it allows the code to fit better into the CPU's L1 or L2 cache. I also prefer to use the -Wall flag to report all warnings. This is an excellent practice.

 
MinGW Links
MinGW Home
Users Mail Archive
MinGW Bug List
Gnu C Home

Willus.com Links
Willus.com Home
Win32 Compilers
Win32 Software
Compiler Benchmark

About willus.com This page last modified
Sunday, 02-Jan-2005 15:15:51 EST
News