d: Fix d_signed_or_unsigned_type is invoked for vector types (PR110193)
commit9757e4440bd8755d327601a60a73d57d712583ed
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 28 Jun 2023 15:38:16 +0000 (28 17:38 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 28 Jun 2023 15:53:11 +0000 (28 17:53 +0200)
tree1ec21d8603217ecfb3b0c09495e46daa3dd4eeff
parent4de22e25918f6fe40184c444ba6d81b19b806e26
d: Fix d_signed_or_unsigned_type is invoked for vector types (PR110193)

This function can be invoked on VECTOR_TYPE, but the implementation
assumes it works on integer types only.  To fix, added a check whether
the type passed is any `__vector(T)' or non-integral type, and return
early by calling `signed_or_unsigned_type_for()' instead.

Problem was found by instrumenting TYPE_PRECISION and ICEing when
applied on VECTOR_TYPEs.

PR d/110193

gcc/d/ChangeLog:

* types.cc (d_signed_or_unsigned_type): Handle being called with any
vector or non-integral type.
gcc/d/types.cc