public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Jason Merrill <jason@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>, <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c, c++: Add new value for vector types for __builtin_classify_type (type)
Date: Thu, 16 Nov 2023 23:49:03 +0000	[thread overview]
Message-ID: <788ba79-04d-f041-3bea-9172e33cd66@codesourcery.com> (raw)
In-Reply-To: <bf652685-5f61-4be0-923b-edce9d2835bd@redhat.com>

On Thu, 16 Nov 2023, Jason Merrill wrote:

> On 11/11/23 03:22, Jakub Jelinek wrote:
> > Hi!
> > 
> > While filing a clang request to return 18 on _BitInts for
> > __builtin_classify_type instead of -1 they return currently, I've
> > noticed that we return -1 for vector types.  I'm not convinced it is a good
> > idea to change behavior of __builtin_classify_type (vector_expression)
> > after 22 years it behaved one way (returned -1), but the
> > __builtin_classify_type (type) form is a new extension added for GCC 14,
> > so this patch returns 19 for vectors just in that second form.  Many other
> > return values are only accessible from the second form as well (mostly
> > because
> > of argument promotions), so I think it is fine like that.
> > 
> > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> The C++ changes are OK (and obvious).  I'm skeptical of the choice to keep
> returning -1 for the expression form, it seems more likely to cause problems
> (due to it disagreeing with the type form) than changing it (due to old code
> somehow relying on -1?).  But people who are more familiar with the use of
> __builtin_classify_type should make the call.

I'm also doubtful of keeping returning -1 for vectors in expression form 
(I'd be surprised if people are actually using __builtin_classify_type 
with vectors).  The C changes are OK (but the front-end changes wouldn't 
be needed at all if the vector and type argument cases aren't 
distinguished).

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2023-11-16 23:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-11  8:22 Jakub Jelinek
2023-11-16 21:52 ` Jason Merrill
2023-11-16 23:49   ` Joseph Myers [this message]
2023-11-17 14:04     ` [PATCH] middle-end, v2: Add new value for vector types for __builtin_classify_type Jakub Jelinek
2023-11-20  8:03       ` Richard Biener
2023-11-20  9:41         ` Jakub Jelinek

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=788ba79-04d-f041-3bea-9172e33cd66@codesourcery.com \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    /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).