From e219e495bc5f009f59c5bdabf8905f7630d10fc6 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Thu, 5 Nov 2015 09:46:10 +0000 Subject: [PATCH] targhooks.c (default_get_mask_mode): Use BLKmode in case target doesn't support required vector mode. gcc/ 2015-10-29 Ilya Enkovich * targhooks.c (default_get_mask_mode): Use BLKmode in case target doesn't support required vector mode. * stor-layout.c (layout_type); Check for BLKmode. From-SVN: r229794 --- gcc/ChangeLog | 6 ++++++ gcc/stor-layout.c | 3 ++- gcc/targhooks.c | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 99ad1589cab..2e58c51ad70 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-11-05 Ilya Enkovich + + * targhooks.c (default_get_mask_mode): Use BLKmode in + case target doesn't support required vector mode. + * stor-layout.c (layout_type); Check for BLKmode. + 2015-11-04 Aditya Kumar Sebastian Pop diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 2e258ce987e..364a0b5454b 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2174,7 +2174,8 @@ layout_type (tree type) TYPE_SATURATING (type) = TYPE_SATURATING (TREE_TYPE (type)); TYPE_UNSIGNED (type) = TYPE_UNSIGNED (TREE_TYPE (type)); /* Several boolean vector elements may fit in a single unit. */ - if (VECTOR_BOOLEAN_TYPE_P (type)) + if (VECTOR_BOOLEAN_TYPE_P (type) + && type->type_common.mode != BLKmode) TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (type->type_common.mode)); else diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 6deb7b1e3a0..14324b7addc 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1087,10 +1087,16 @@ default_get_mask_mode (unsigned nunits, unsigned vector_size) unsigned elem_size = vector_size / nunits; machine_mode elem_mode = smallest_mode_for_size (elem_size * BITS_PER_UNIT, MODE_INT); + machine_mode vector_mode; gcc_assert (elem_size * nunits == vector_size); - return mode_for_vector (elem_mode, nunits); + vector_mode = mode_for_vector (elem_mode, nunits); + if (VECTOR_MODE_P (vector_mode) + && !targetm.vector_mode_supported_p (vector_mode)) + vector_mode = BLKmode; + + return vector_mode; } /* By default, the cost model accumulates three separate costs (prologue, -- 2.30.2