On Wed, Dec 16, 2020 at 04:30:00PM +0000, Sven C. Dack via Gcc-help wrote: > Could some of the GCC experts please share their knowledge on this issue? > >I've come across an unexpected behaviour of gcc and wanted to ask for > >help. I've noticed that when I specify '-march=znver2' does gcc use the > >incorrect values for the L1/L2 cache. Only when '-march=native' was used > >and gcc detected the CPU at run-time does it use the correct values. For > >example on a Ryzen 7 3800X (a Zen 2 CPU): -march=native uses cpuid to get the cache info (or in general, looks at the system it is running on). -march=znver2 does not. I do not know if -march=znver2 should use better defaults. > >Why does GCC not use the correct L1/L2 cache values when '-march=znver2' > >or '-mtune=znver2' is specified? Please open a PR? https://gcc.gnu.org/bugs.html . Thanks! Segher