public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97324] New: -mcpu=<value> isn't validated on x86
@ 2020-10-07 17:38 kip at thevertigo dot com
  2020-10-08  7:43 ` [Bug target/97324] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: kip at thevertigo dot com @ 2020-10-07 17:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

            Bug ID: 97324
           Summary: -mcpu=<value> isn't validated on x86
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kip at thevertigo dot com
  Target Milestone: ---

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
@ 2020-10-08  7:43 ` rguenth at gcc dot gnu.org
  2020-10-08 11:58 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-08  7:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
it works for me with GCC 11

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
  2020-10-08  7:43 ` [Bug target/97324] " rguenth at gcc dot gnu.org
@ 2020-10-08 11:58 ` marxin at gcc dot gnu.org
  2020-10-08 16:30 ` kip at thevertigo dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-08 11:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
  2020-10-08  7:43 ` [Bug target/97324] " rguenth at gcc dot gnu.org
  2020-10-08 11:58 ` marxin at gcc dot gnu.org
@ 2020-10-08 16:30 ` kip at thevertigo dot com
  2020-10-08 16:36 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: kip at thevertigo dot com @ 2020-10-08 16:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

--- Comment #3 from Kip Warner <kip at thevertigo dot com> ---
Martin, is -mcpu deprecated for all architectures or just x86?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
                   ` (2 preceding siblings ...)
  2020-10-08 16:30 ` kip at thevertigo dot com
@ 2020-10-08 16:36 ` jakub at gcc dot gnu.org
  2020-10-08 16:43 ` kip at thevertigo dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-08 16:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
-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).

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
                   ` (3 preceding siblings ...)
  2020-10-08 16:36 ` jakub at gcc dot gnu.org
@ 2020-10-08 16:43 ` kip at thevertigo dot com
  2020-10-08 16:57 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: kip at thevertigo dot com @ 2020-10-08 16:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

--- Comment #5 from Kip Warner <kip at thevertigo dot com> ---
The reason I asked is because of that inconsistency in the -mcpu usage on
targets. Thanks for clarifying.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
                   ` (4 preceding siblings ...)
  2020-10-08 16:43 ` kip at thevertigo dot com
@ 2020-10-08 16:57 ` jakub at gcc dot gnu.org
  2020-10-08 17:03 ` kip at thevertigo dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-08 16:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
                   ` (5 preceding siblings ...)
  2020-10-08 16:57 ` jakub at gcc dot gnu.org
@ 2020-10-08 17:03 ` kip at thevertigo dot com
  2020-10-08 17:08 ` jakub at gcc dot gnu.org
  2020-10-08 17:09 ` kip at thevertigo dot com
  8 siblings, 0 replies; 10+ messages in thread
From: kip at thevertigo dot com @ 2020-10-08 17:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

--- Comment #7 from Kip Warner <kip at thevertigo dot com> ---
I understand what you mean from a maintainer's standpoint. But from a user's
standpoint, that's an inconsistency.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
                   ` (6 preceding siblings ...)
  2020-10-08 17:03 ` kip at thevertigo dot com
@ 2020-10-08 17:08 ` jakub at gcc dot gnu.org
  2020-10-08 17:09 ` kip at thevertigo dot com
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-08 17:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/97324] -mcpu=<value> isn't validated on x86
  2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
                   ` (7 preceding siblings ...)
  2020-10-08 17:08 ` jakub at gcc dot gnu.org
@ 2020-10-08 17:09 ` kip at thevertigo dot com
  8 siblings, 0 replies; 10+ messages in thread
From: kip at thevertigo dot com @ 2020-10-08 17:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97324

--- Comment #9 from Kip Warner <kip at thevertigo dot com> ---
Yup. Agreed.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-10-08 17:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 17:38 [Bug c/97324] New: -mcpu=<value> isn't validated on x86 kip at thevertigo dot com
2020-10-08  7:43 ` [Bug target/97324] " rguenth at gcc dot gnu.org
2020-10-08 11:58 ` marxin at gcc dot gnu.org
2020-10-08 16:30 ` kip at thevertigo dot com
2020-10-08 16:36 ` jakub at gcc dot gnu.org
2020-10-08 16:43 ` kip at thevertigo dot com
2020-10-08 16:57 ` jakub at gcc dot gnu.org
2020-10-08 17:03 ` kip at thevertigo dot com
2020-10-08 17:08 ` jakub at gcc dot gnu.org
2020-10-08 17:09 ` kip at thevertigo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).