https://wiki.gentoo.org/wiki/Ryzen#GCC says, neither GCC 6.x nor GCC 7 is Ryzen optimized. But, when doing man gcc-7 I clearly see march=znver1 is available in GCC-7. Or is this just a dummy option doing nothing? I´d like to use march=znver1 to get my kernel a bit more optimized for my Ryzen 2500U. In my distro there is actually GCC-9 and GCC-10 available, I could upgrade from 7 to 9 or 10.


1 Answer 1


znver1 was added to GCC in 2015, and included in GCC 6.1. It has always provided some level of tuning for Zen CPUs (see the cost tables in that first commit), but the Phoronix benchmarks quoted by the Gentoo wiki suggest that that wasn’t particularly effective at the time.

In general, when it comes to compiler support and optimisation for “newer” architectures, newer releases of the compiler are better — optimisation improvements are rarely back-ported, and they take time to be developed in the compilers. This includes the many patches which have helped improved the performance of code generated for Zen CPUs (look for patches by Jan Hubicka in particular). As always when it comes to performance, you should benchmark the scenarios you care about.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .