aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-05-26 09:47:26 +0200
committerRichard Biener <rguenther@suse.de>2020-05-26 15:58:32 +0200
commit1d72079ba3a370d6751953312f0de76d1a1c555d (patch)
tree2b961c24057859b5d4e3404ac732aa6fca740c98
parent9b8579a6b3664d202db23af60a2ab6cc1f9eb5ae (diff)
downloadgcc-1d72079ba3a370d6751953312f0de76d1a1c555d.zip
gcc-1d72079ba3a370d6751953312f0de76d1a1c555d.tar.gz
gcc-1d72079ba3a370d6751953312f0de76d1a1c555d.tar.bz2
tree-optimization/95327 - fix another vectorizable_shift const SLP op
This fixes another case where we fail to set the type on a SLP constant operand in vectorizable_shift. 2020-05-26 Richard Biener <rguenther@suse.de> PR tree-optimization/95327 * tree-vect-stmts.c (vectorizable_shift): Compute op1_vectype when we are not using a scalar shift.
-rw-r--r--gcc/tree-vect-stmts.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 76c7b99..225a9dc 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -5733,13 +5733,19 @@ vectorizable_shift (vec_info *vinfo,
dump_printf_loc (MSG_NOTE, vect_location,
"vector/vector shift/rotate found.\n");
+ if (!op1_vectype)
+ op1_vectype = get_vectype_for_scalar_type (vinfo,
+ TREE_TYPE (op1),
+ slp_node);
+
/* Unlike the other binary operators, shifts/rotates have
the rhs being int, instead of the same type as the lhs,
so make sure the scalar is the right type if we are
dealing with vectors of long long/long/short/char. */
incompatible_op1_vectype_p
- = !tree_nop_conversion_p (TREE_TYPE (vectype),
- TREE_TYPE (op1));
+ = (!op1_vectype
+ || !tree_nop_conversion_p (TREE_TYPE (vectype),
+ TREE_TYPE (op1)));
}
}
}