in some benchmarks earlier this year I had gcc being mostly faster for generic -O2 or -O3 but clang and gcc were very similar for "generic" code when the "full-opt" (as below) were activated.
clang would then outperform gcc on "good" code (e.g.: easily vectorizable code generated by Heavy)
This was clang 3.5 I believe.
These days, every time I compare clang 3.8 vs gcc4.9, the former always performs better and is often much quicker at compiling.
Occasionally, though for VERY LARGE files (some 10k lines heavy or faust-generated files), clang could be much slower at compiling.
Also there were unpredictable differences between linaro's cross-gcc 4.9 on Mac and native gcc 4.9 on Bela ..
gcc full-opt: -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon --fast-math -ftree-vectorize -ftree-vectorizer-verbose=1
clang full-opt: -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize
_main.pd(techno world) heavy:
gcc-4.6 -O2 49%
gcc-4.6 -O3 49%
gcc-4.6 full-opt 48%
gcc-4.9 -O2 48.5%
gcc-4.9 -O3 48.5%
gcc-4.9 full-opt 43.8%
gcc-5.0 full-opt 44%
clang -O2 53%
clang -O3 53%
clang full-opt 26%
_main.pd(techno world) libpd:
gcc-4.9 fullopt 53.2%
clang full-opt 52.8%
airharp (C++ project)
clang -O3 69%
clang full-opt 63.5%
gcc-4.9 -O3 68.7%
gcc-4.9 fullopt 63%
Supercollider
buildnativeclangdefault
idle 16%
120sinewaves 49.3%
buildnativeclangvectorize
idle 15.8%
120sinewaves 50%
___________________buildnativegcc49default______
idle 21%
120sinewaves51%
___________________buildnativegcc49vectorizeffastmath__________________
idle 16%
120sinewaves 49.5%
___________________buildcrossgccdefault__________________
idle 17.3%
120sinewaves 48.3%
___________________buildcrossgccvectorizefastmath__________________
idle 17.7%
120sinewaves 47.5%