diff options
author | Richard Biener <rguenther@suse.de> | 2021-01-05 14:23:55 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-01-05 15:54:42 +0100 |
commit | 01da03c915f086fb9aa36b809c1a06a9f661533b (patch) | |
tree | 44061e426db18709683d913e9f0676fa9771a53b /gcc/tree-vect-loop.c | |
parent | 1ff0ddcd8b4728bcc96e1daf2e70a03dc9fbf171 (diff) | |
download | gcc-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-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 830531f..965cc16 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -8494,7 +8494,7 @@ vectorizable_live_operation (vec_info *vinfo, { loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo); imm_use_iterator imm_iter; - tree lhs, lhs_type, bitsize, vec_bitsize; + tree lhs, lhs_type, bitsize; tree vectype = (slp_node ? SLP_TREE_VECTYPE (slp_node) : STMT_VINFO_VECTYPE (stmt_info)); @@ -8637,7 +8637,6 @@ vectorizable_live_operation (vec_info *vinfo, lhs_type = TREE_TYPE (lhs); bitsize = vector_element_bits_tree (vectype); - vec_bitsize = TYPE_SIZE (vectype); /* Get the vectorized lhs of STMT and the lane to use (counted in bits). */ tree vec_lhs, bitstart; @@ -8661,7 +8660,7 @@ vectorizable_live_operation (vec_info *vinfo, vec_lhs = gimple_get_lhs (vec_stmt); /* Get the last lane in the vector. */ - bitstart = int_const_binop (MINUS_EXPR, vec_bitsize, bitsize); + bitstart = int_const_binop (MULT_EXPR, bitsize, bitsize_int (nunits - 1)); } if (loop_vinfo) |