holmqvist.fredrik@xxxxxxxxxxxx - 2009-03-08 15:09 :
(I know mtune and march is basically the same)
No, -march determines the allowed instructions in the generated code. This determines on what kind of CPUs the code can run, e.g. -march=i686 breaks on K-6.
-mtune however only influences the behavior of the peephole optimizer, that is which instruction sequences and instruction ordering are used in the generated code. It doesn't influence program compatibility. This flag can probably have a significant impact on performance, especially when code compiled for modern out-of-order CPUS is run on in-order designs like the Pentium or Atom (the code would probably run quite slow). Your choice of i586 should be fine, as it is identical to the pentium settings. It doesn't perform optimally on modern CPUs, but doesn't hurt the old ones.