diff options
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 11 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 59661ef..3f195eb 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2020-03-20 Richard Sandiford <richard.sandiford@arm.com> + + PR middle-end/94072 + * c-common.c (c_common_type_for_mode): Before using a registered + built-in type, check that the vectorness of the type matches + the vectorness of the mode. + 2020-03-17 Jakub Jelinek <jakub@redhat.com> * c-common.c (resolve_overloaded_builtin): Fix up duplicated word diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 25020bf14..8e5a924 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -2387,10 +2387,13 @@ c_common_type_for_mode (machine_mode mode, int unsignedp) } for (t = registered_builtin_types; t; t = TREE_CHAIN (t)) - if (TYPE_MODE (TREE_VALUE (t)) == mode - && !!unsignedp == !!TYPE_UNSIGNED (TREE_VALUE (t))) - return TREE_VALUE (t); - + { + tree type = TREE_VALUE (t); + if (TYPE_MODE (type) == mode + && VECTOR_TYPE_P (type) == VECTOR_MODE_P (mode) + && !!unsignedp == !!TYPE_UNSIGNED (type)) + return type; + } return NULL_TREE; } |