tree-optimization/97081 - fix wrong-code with vectorized shift
authorRichard Biener <rguenther@suse.de>
Fri, 18 Sep 2020 11:36:24 +0000 (13:36 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 18 Sep 2020 12:48:42 +0000 (14:48 +0200)
commit9c9b88fdcff3520b2c4fb520c5d3b422eaa9a72f
treed4ddf6cfb0bcd6d65a75c889ee527c041c141bb8
parent2f8022873c72e4abed7987cfa6b8ab9de6e53971
tree-optimization/97081 - fix wrong-code with vectorized shift

This corrects the mask for creation of x << s | x >> (-x & mask)
from a rotate x <<r s to use the precision of x.

2020-09-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97081
* tree-vect-patterns.c (vect_recog_rotate_pattern): Use the
precision of the shifted operand to determine the mask.

* gcc.dg/vect/pr97081.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr97081.c [new file with mode: 0644]
gcc/tree-vect-patterns.c