Skip to content
Snippets Groups Projects
Commit 1a599caa authored by Richard Biener's avatar Richard Biener
Browse files

tree-optimization/110838 - vectorization of widened right shifts

The following fixes a problem with my last attempt of avoiding
out-of-bound shift values for vectorized right shifts of widened
operands.  Instead of truncating the shift amount with a bitwise
and we actually need to saturate it to the target precision.

The following does that and adds test coverage for the constant
and invariant but variable case that would previously have failed.

	PR tree-optimization/110838
	* tree-vect-patterns.cc (vect_recog_over_widening_pattern):
	Fix right-shift value sanitizing.  Properly emit external
	def mangling in the preheader rather than in the pattern
	def sequence where it will fail vectorizing.

	* gcc.dg/vect/pr110838.c: New testcase.
parent 0782b01c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment