public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98274] New: -march=x86-64-v[234] incompatible with target attribute
@ 2020-12-14 13:42 jakub at gcc dot gnu.org
  2020-12-14 13:42 ` [Bug target/98274] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-14 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98274
           Summary: -march=x86-64-v[234] incompatible with target
                    attribute
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

void __attribute__((target ("avx")))
foo (void)
{
}

fails to compile with -march=x86-64-v2 :
~/src/gcc/obj04/gcc/xgcc -B ~/src/gcc/obj04/gcc/ -S -O2 qauquu.c
-march=x86-64-v2
qauquu.c:3:1: error: bad value (‘x86-64-v2’) for ‘target("tune=")’ attribute
    3 | {
      | ^
qauquu.c:3:1: note: valid arguments to ‘target("tune=")’ attribute 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 znver3 btver1 btver2 generic native; did you
mean ‘x86-64’?

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

* [Bug target/98274] -march=x86-64-v[234] incompatible with target attribute
  2020-12-14 13:42 [Bug target/98274] New: -march=x86-64-v[234] incompatible with target attribute jakub at gcc dot gnu.org
@ 2020-12-14 13:42 ` jakub at gcc dot gnu.org
  2020-12-14 13:47 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-14 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-12-14
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

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

* [Bug target/98274] -march=x86-64-v[234] incompatible with target attribute
  2020-12-14 13:42 [Bug target/98274] New: -march=x86-64-v[234] incompatible with target attribute jakub at gcc dot gnu.org
  2020-12-14 13:42 ` [Bug target/98274] " jakub at gcc dot gnu.org
@ 2020-12-14 13:47 ` jakub at gcc dot gnu.org
  2020-12-15  9:17 ` cvs-commit at gcc dot gnu.org
  2020-12-15  9:19 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-14 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49760
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49760&action=edit
gcc11-pr98274.patch

Untested fix.

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

* [Bug target/98274] -march=x86-64-v[234] incompatible with target attribute
  2020-12-14 13:42 [Bug target/98274] New: -march=x86-64-v[234] incompatible with target attribute jakub at gcc dot gnu.org
  2020-12-14 13:42 ` [Bug target/98274] " jakub at gcc dot gnu.org
  2020-12-14 13:47 ` jakub at gcc dot gnu.org
@ 2020-12-15  9:17 ` cvs-commit at gcc dot gnu.org
  2020-12-15  9:19 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-15  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:69bd5d473d22157d0737fc20e98eb3347cbd6ab5

commit r11-6041-g69bd5d473d22157d0737fc20e98eb3347cbd6ab5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Dec 15 10:16:08 2020 +0100

    i386: Fix up -march=x86-64-v[234] vs. target attribute [PR98274]

    The following testcase fails to compile.  The problem is that
    when ix86_option_override_internal is called the first time for command
    line, it sees -mtune= wasn't present on the command line and so as fallback
    sets ix86_tune_string to ix86_arch_string value ("x86-64-v2"), but
    ix86_tune_specified is false, so we don't find the tuning in the table
    but don't error on it.
    When processing the target attribute, ix86_tune_string is what
    it was earlier left with, but this time ix86_tune_specified is true and
    so we error on it.

    The following patch does what is done already e.g. for "x86-64" march,
    in particular default the tuning to "generic".

    2020-12-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/98274
            * config/i386/i386-options.c (ix86_option_override_internal): Set
            ix86_tune_string to "generic" even when it wasn't specified and
            ix86_arch_string is "x86-64-v2", "x86-64-v3" or "x86-64-v4".
            Remove useless {}s around a single statement.

            * gcc.target/i386/pr98274.c: New test.

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

* [Bug target/98274] -march=x86-64-v[234] incompatible with target attribute
  2020-12-14 13:42 [Bug target/98274] New: -march=x86-64-v[234] incompatible with target attribute jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-15  9:17 ` cvs-commit at gcc dot gnu.org
@ 2020-12-15  9:19 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-15  9:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-12-15  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 13:42 [Bug target/98274] New: -march=x86-64-v[234] incompatible with target attribute jakub at gcc dot gnu.org
2020-12-14 13:42 ` [Bug target/98274] " jakub at gcc dot gnu.org
2020-12-14 13:47 ` jakub at gcc dot gnu.org
2020-12-15  9:17 ` cvs-commit at gcc dot gnu.org
2020-12-15  9:19 ` jakub at gcc dot gnu.org

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).