On amd64 I see the following: $ gcc-10 -Q --help=param -mcpu=sdfdsf gcc-10: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead The following options control parameters: --param=align-loop-iterations= 4 (...) On my POWER9 machine I see the following: $ gcc-10 -Q --help=param -mcpu=sdfdsf gcc-10: error: unrecognized argument in option ‘-mcpu=sdfdsf’ gcc-10: note: valid arguments to ‘-mcpu=’ are: 401 403 405 405fp 440 440fp 464 464fp 476 476fp 505 601 602 603 603e 604 604e 620 630 740 7400 7450 750 801 821 823 8540 8548 860 970 G3 G4 G5 a2 cell e300c2 e300c3 e500mc e500mc64 e5500 e6500 ec603e native power10 power3 power4 power5 power5+ power6 power6x power7 power8 power9 powerpc powerpc64 powerpc64le rs64 titan Note that on amd64 the CPU value's nonsensical value was not validated.
it works for me with GCC 11
Well for GCC 11 we provide: gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead cc1: error: bad value (‘sdfdsf’) for ‘-mtune=’ switch cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 generic native So -mcpu is deprecated and we print valid values for -mtune argument. Fixed on master with r11-2755-ga7bbb5b1b1eb09db.
Martin, is -mcpu deprecated for all architectures or just x86?
-m* options are target specific, so each target can and often does have its own. -mcpu= is deprecated just on x86, but many other targets don't even have -mcpu= and never had, etc. On the other side, some targets like powerpc do use -mcpu= where other targets use -march= instead, or some have even more complicated handling (arm/aarch64).
The reason I asked is because of that inconsistency in the -mcpu usage on targets. Thanks for clarifying.
There is no consistency. Targets that have all of -march=, -mcpu= and -mtune=: aarch64, arm, cris, i386 (-mcpu= deprecated and treated as -mtune=), m68k Targets that have just -march= and -mtune=: gcn, mips, riscv, s390 Targets that have just -march= and -mcpu=: csky, iq2000, nds32 Targets that have just -mcpu= and -mtune=: alpha, arc, rs6000, sparc, visium Targets that have just -mcpu=: bfin, frv, m32c, microblaze, msp430, rl78, rx, tilegx, tilepro Targets that have just -mtune=: ia64, mn10300 Targets that have just -march=: c6x, nios2, pa
I understand what you mean from a maintainer's standpoint. But from a user's standpoint, that's an inconsistency.
Except for native supported on a subset of the architectures, no values are the same, so this is highly target specific anyway. And yes, were it designed all now, we'd use the same options, but some of these choices are 33 years old, others 10, 20, 30 etc., so it is difficult to adjust it now without breaking stuff too much.
Yup. Agreed.