I will ask my question by giving an example. Now I have a function called do_something().
It has three versions: do_something(), do_s
Here is an example of compiling a separate object file for each optimization setting: http://notabs.org/lfsr/software/index.htm
But even this method fails when gcc link time optimization (-flto) is used. So how can a single executable be built with full optimization for different processors? The only solution I can find is to use include directives to make the C files behave as a single compilation unit so that -flto is not needed. Here is an example using that method: http://notabs.org/blcutil/index.htm