http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61043
Andi Kleen <andi-gcc at firstfloor dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andi-gcc at firstfloor dot org --- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> --- Yes LTO doesn't support different options for different files, and combines some of them (which happens in your case) and ignores some others. You could use tag the functions in the different file with __attribute__(target("...")) This will also allow automatic switching. Arguably gcc should do this automatically for LTO, but unfortunately it doesn't Or alternatively don't compile the file that needs the changed options with LTO