Willus.org Home   |   Archive   |   About  

Willus.com's MinGW/Gnu C Tips

MinGW Tips
Install Notes
Starter Links
Compile Flags
Fast Math Funcs
Binary Stdout
Predefined Macros
Linker Map
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
MinGW64 Home
MinGW Home
Users Mail Archive
MinGW Bug List
Gnu C Home

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

This page last modified
Saturday, 13-Jun-2020 10:54:52 PDT