aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-01-05 14:23:55 +0100
committerRichard Biener <rguenther@suse.de>2021-01-05 15:54:42 +0100
commit01da03c915f086fb9aa36b809c1a06a9f661533b (patch)
tree44061e426db18709683d913e9f0676fa9771a53b /gcc/tree.c
parent1ff0ddcd8b4728bcc96e1daf2e70a03dc9fbf171 (diff)
downloadgcc-01da03c915f086fb9aa36b809c1a06a9f661533b.zip
gcc-01da03c915f086fb9aa36b809c1a06a9f661533b.tar.gz
gcc-01da03c915f086fb9aa36b809c1a06a9f661533b.tar.bz2
tree-optimization/98381 - fix live bool vector extract
This fixes extraction of live bool vector results for the case of integer mode vectors. 2021-01-05 Richard Biener <rguenther@suse.de> PR tree-optimization/98381 * tree.c (vector_element_bits): Properly compute bool vector element size. * tree-vect-loop.c (vectorizable_live_operation): Properly compute the last lane bit offset.
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 421a2b4..e0a1d512 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -14021,8 +14021,13 @@ vector_element_bits (const_tree type)
{
gcc_checking_assert (VECTOR_TYPE_P (type));
if (VECTOR_BOOLEAN_TYPE_P (type))
- return vector_element_size (tree_to_poly_uint64 (TYPE_SIZE (type)),
- TYPE_VECTOR_SUBPARTS (type));
+ {
+ if (VECTOR_MODE_P (TYPE_MODE (type)))
+ return vector_element_size (tree_to_poly_uint64 (TYPE_SIZE (type)),
+ TYPE_VECTOR_SUBPARTS (type));
+ else
+ return 1;
+ }
return tree_to_uhwi (TYPE_SIZE (TREE_TYPE (type)));
}