public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aoliva at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/114803] simd conversion to [[gnu::vector_size(N)]] type hits invalid code in experimental/bits/simd_builtin.h
Date: Fri, 31 May 2024 10:59:41 +0000	[thread overview]
Message-ID: <bug-114803-4-1vs51OKkrx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114803-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
FWIW, I can trigger the problem on arm-eabi (and presumably also on
aarch64-elf, but I haven't tried that) with -D__clang__.

(our vxworks toolchains have to define that macro, for complicated reasons)

here's a reduced testcase:

arm-eabi-g++ ~/pr114803.cc -mfpu=neon -mfloat-abi=hard -O0 -std=gnu++17
-D__clang__ [-funsigned-char]

include <experimental/simd>

template <typename T>
void
test()
{
  using V = std::experimental::simd<T,
std::experimental::simd_abi::_VecBuiltin<16> >;
  if constexpr (std::is_signed_v<T>)
    static_cast<int8x16_t>(V{});
  else
    static_cast<uint8x16_t>(V{});
}

int main()
{
  test<char>();
}

pr114803.cc: In instantiation of ‘void test() [with T = char]’:
pr114803.cc:16:   required from here
pr114803.cc:11: error: invalid ‘static_cast’ from type
‘std::experimental::parallelism_v2::simd<char,
std::experimental::parallelism_v2::simd_abi::_VecBuiltin<16> >’ to type
‘uint8x16_t’

  parent reply	other threads:[~2024-05-31 10:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 12:56 [Bug libstdc++/114803] New: " mkretz at gcc dot gnu.org
2024-04-22 12:58 ` [Bug libstdc++/114803] " mkretz at gcc dot gnu.org
2024-04-22 18:56 ` cvs-commit at gcc dot gnu.org
2024-04-22 18:58 ` mkretz at gcc dot gnu.org
2024-05-07 16:19 ` cvs-commit at gcc dot gnu.org
2024-05-08 16:15 ` cvs-commit at gcc dot gnu.org
2024-05-10 14:07 ` cvs-commit at gcc dot gnu.org
2024-05-10 14:24 ` mkretz at gcc dot gnu.org
2024-05-30  8:14 ` aoliva at gcc dot gnu.org
2024-05-30 12:04 ` aoliva at gcc dot gnu.org
2024-05-31  8:47 ` mkretz at gcc dot gnu.org
2024-05-31 10:59 ` aoliva at gcc dot gnu.org [this message]
2024-05-31 11:45 ` aoliva at gcc dot gnu.org
2024-05-31 13:42 ` mkretz at gcc dot gnu.org
2024-05-31 14:18 ` mkretz at gcc dot gnu.org
2024-05-31 17:16 ` aoliva at gcc dot gnu.org
2024-06-02 15:05 ` mkretz at gcc dot gnu.org
2024-06-06  7:50 ` aoliva 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-114803-4-1vs51OKkrx@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).