GCC Flags

Mar 4, 2012 at 10:35pm
Hello all!
In GCC, there are compiler flags for specific processors (e.g. "-march=k6-2" and "-march=core2"). Do these tell the compiler what instructions it can use (the ones supported by the specific processor architecture and later ones which support it), or do they do something else? If so, what?
Thanks in advance.
Mar 4, 2012 at 11:03pm
Yes, it does determine which instructions can be used in the first place, but it can also affect the choice of basic instructions (e.g. inc vs. add 1) and their order, as some intructions might be known to have better latency or throughput on that particular architecture.
Topic archived. No new replies allowed.