public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/110193] New: d_signed_or_unsigned_type is invoked for vector types
@ 2023-06-09 13:06 rguenth at gcc dot gnu.org
  2023-06-09 14:59 ` [Bug d/110193] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-09 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110193
           Summary: d_signed_or_unsigned_type is invoked for vector types
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

It looks like this function (via a langhook) is invoked on VECTOR_TYPE and
the implementation assumes it works on integer types only:

  if (TYPE_PRECISION (type) == TYPE_PRECISION (d_cent_type))
    return unsignedp ? d_ucent_type : d_cent_type;

  if (TYPE_PRECISION (type) == TYPE_PRECISION (d_long_type))
    return unsignedp ? d_ulong_type : d_long_type;
...

TYPE_PRECISION for vectors is TYPE_VECTOR_SUBPARTS so in this case
for any V8mode vector we'd return d_{u,}cent_type.  The C familiy
frontend similar routine does

  type1 = TYPE_MAIN_VARIANT (type);
  if (type1 == signed_char_type_node || type1 == char_type_node || type1 ==
unsigned_char_type_node)
    return unsignedp ? unsigned_char_type_node : signed_char_type_node;
  if (type1 == integer_type_node || type1 == unsigned_type_node)
    return unsignedp ? unsigned_type_node : integer_type_node;

...

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

end of thread, other threads:[~2023-06-29  8:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09 13:06 [Bug d/110193] New: d_signed_or_unsigned_type is invoked for vector types rguenth at gcc dot gnu.org
2023-06-09 14:59 ` [Bug d/110193] " pinskia at gcc dot gnu.org
2023-06-10 18:25 ` ibuclaw at gcc dot gnu.org
2023-06-10 18:40 ` ibuclaw at gcc dot gnu.org
2023-06-10 18:42 ` ibuclaw at gcc dot gnu.org
2023-06-12  7:58 ` rguenth at gcc dot gnu.org
2023-06-28 15:53 ` cvs-commit at gcc dot gnu.org
2023-06-28 16:28 ` ibuclaw at gcc dot gnu.org
2023-06-29  8:16 ` rguenth 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).