Evaluating different C compilers on SWI-Prolog

I had a request to make sure SWI-Prolog compiles clean on GCC-11. The patches to achieve that are uploaded. New compilers always come with new warnings. Typically almost all of these are false positives, but they are usually easy to avoid while making the code cleaner. For GCC-11 the new warnings were all bogus and several required dirty tricks to silence them :frowning:

I had the impression the produced code is also worse. So, I did some evaluation using PGO compiled versions using GCC 9, 10 and 11 on Ubuntu 20.04, AMD3950X, running src/swipl -O ../bench/run.pl. Average time in seconds:

Compiler Average time (sec)
gcc-9 0.177
gcc-10 0.182
gcc-11 0.195

We are not really moving in the right direction :frowning: GCC 9 vs 10 difference is around the noise level. GCC 11 seems to produce measurably slower code :frowning:

3 Likes