aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 7cb1ea1..c3642e3 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -10241,6 +10241,17 @@ signed_or_unsigned_type_for (int unsignedp, tree type)
if (TREE_CODE (type) == INTEGER_TYPE && TYPE_UNSIGNED (type) == unsignedp)
return type;
+ if (TREE_CODE (type) == VECTOR_TYPE)
+ {
+ tree inner = TREE_TYPE (type);
+ tree inner2 = signed_or_unsigned_type_for (unsignedp, inner);
+ if (!inner2)
+ return NULL_TREE;
+ if (inner == inner2)
+ return type;
+ return build_vector_type (inner2, TYPE_VECTOR_SUBPARTS (type));
+ }
+
if (!INTEGRAL_TYPE_P (type)
&& !POINTER_TYPE_P (type))
return NULL_TREE;