Quote Originally Posted by ssam View Post
a good choice of -march might be 'native'. also see http://en.gentoo-wiki.com/wiki/Safe_Cflags

in my own tests with a fortran simulation code O3 beats Os (though this is probably not generally true)

with GCC you might want to look at lto. O3 + lto can make smaller binaries than Os

Also i remember reading an article about how big caches and clever precaching on modern CPUs meant that O3 was better than Os now. i think it was a report by intel. but i can't find it.
"native" should be the same as "core 2" for my hardware. I might include LTO last for GCC along with the ICC-specific settings suggested above for ICC. First going to run through the rest of the compilers though... it takes a long time .