]> git.ipfire.org Git - thirdparty/gcc.git/commit
c, c++: Add new value for vector types for __builtin_classify_type
authorJakub Jelinek <jakub@redhat.com>
Mon, 20 Nov 2023 09:37:59 +0000 (10:37 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 20 Nov 2023 09:44:31 +0000 (10:44 +0100)
commit509b470dcee9795887a60ddb32ab454f22e74411
tree43976a234b5f9cbedde25573c5e4bed681d96070
parentf25a5b199a0ebd4695466e665e49041339f0c6a7
c, c++: Add new value for vector types for __builtin_classify_type

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.  Initially I wanted to change
behavior just for __builtin_classify_type (type) form, as that is new in
GCC 14 and we've returned for 20+ years -1 for __builtin_classify_type
on vector expressions, but I was convinved otherwise, so this changes
the behavior even for that and now returns 19.

2023-11-20  Jakub Jelinek  <jakub@redhat.com>

gcc/
* typeclass.h (enum type_class): Add vector_type_class.
* builtins.cc (type_to_class): Return vector_type_class for
VECTOR_TYPE.
* doc/extend.texi (__builtin_classify_type): Mention bit-precise
integer types and vector types.
gcc/testsuite/
* c-c++-common/builtin-classify-type-1.c (main): Add tests for vector
types.
gcc/builtins.cc
gcc/doc/extend.texi
gcc/testsuite/c-c++-common/builtin-classify-type-1.c
gcc/typeclass.h