Free software relies heavily on the GNU Compiler Collection,GCC. GCC is a reliable and standards compiler and is free software too. However, it does not always generate the best code. Dosbox user might want to use different compilers.
The Pathscale compiler (http://www.pathscale.com) is a compiler that comes under GPL license. While technically free software, it is not free of charge. It has very advanced loop vectorizers to make use of SSE instructions, and makes good use of prefetch instructions to improve effective memory bandwidth. It allows great speed gains on the video and audio processing parts of Dosbox.
Compiling dosbox with maximum optimizations (-Ofast) does not work, it results in an error during linker. The cause of this is the interprocedural analysis option (-ipa), which is activated with -Ofast. Therefore we manually enable all optimizations activated by -Ofast, except -ipa. This is: -O3 -OPT:Ofast -fno-math-errno -ffast-math
This, to compile Dosbox using Pathscale, you can use:
./configure CC=pathcc CXX=pathCC CFLAGS="-O3 -OPT:Ofast -fno-math-errno -ffast-math" CXXFLAGS="-O3 -OPT:Ofast -fno-math-errno -ffast-math" make make install
When the above has finished, you can enjoy a nice performance improvement in Dosbox.