public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/100270] New: _Generic can't distinguish VLS SVE vectors and GNU vectors
Date: Mon, 26 Apr 2021 15:33:02 +0000	[thread overview]
Message-ID: <bug-100270-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100270
           Summary: _Generic can't distinguish VLS SVE vectors and GNU
                    vectors
           Product: gcc
           Version: 10.3.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*-*-*

Compiling the following test with -march=armv8.2-a+sve -msve-vector-bits=256:

---------------------------------------------------------------------------
#include <arm_sve.h>

typedef svint32_t vls_svint32_t __attribute__((arm_sve_vector_bits(256)));
typedef int32_t gnu_svint32_t __attribute__((vector_size(32)));

int
f (vls_svint32_t x)
{
  return _Generic(x, vls_svint32_t: 1, gnu_svint32_t: 2, default: -1);
}
---------------------------------------------------------------------------

gives:

a.c: In function ‘f’:
a.c:9:40: error: ‘_Generic’ specifies two compatible types
    9 |   return _Generic(x, vls_svint32_t: 1, gnu_svint32_t: 2, default: -1);
      |                                        ^~~~~~~~~~~~~
a.c:9:22: note: compatible type is here
    9 |   return _Generic(x, vls_svint32_t: 1, gnu_svint32_t: 2, default: -1);
      |                      ^~~~~~~~~~~~~
a.c:9:40: error: ‘_Generic’ selector matches multiple associations
    9 |   return _Generic(x, vls_svint32_t: 1, gnu_svint32_t: 2, default: -1);
      |                                        ^~~~~~~~~~~~~
a.c:9:22: note: other match is here
    9 |   return _Generic(x, vls_svint32_t: 1, gnu_svint32_t: 2, default: -1);
      |                      ^~~~~~~~~~~~~

This is because aarch64_comp_type_attributes needs to return
false for this combination of types.

             reply	other threads:[~2021-04-26 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 15:33 rsandifo at gcc dot gnu.org [this message]
2021-04-26 15:33 ` [Bug target/100270] " rsandifo at gcc dot gnu.org
2021-04-27 11:18 ` cvs-commit at gcc dot gnu.org
2021-04-27 11:21 ` [Bug target/100270] [10/11 Backport] " rsandifo at gcc dot gnu.org
2021-04-29  8:28 ` cvs-commit at gcc dot gnu.org
2022-06-28 10:44 ` [Bug target/100270] [10 " jakub at gcc dot gnu.org
2023-07-07  9:38 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100270-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).