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

tree-optimization/91838 - fix FAIL of g++.dg/opt/pr91838.C

The following fixes the lack of simplification of a vector shift
by an out-of-bounds shift value.  For scalars this is done both
by CCP and VRP but vectors are not handled there.  This results
in PR91838 differences in outcome dependent on whether a vector
shift ISA is available and thus vector lowering does or does not
expose scalar shifts here.

The following adds a match.pd pattern to catch uniform out-of-bound
shifts, simplifying them to zero when not sanitizing shift amounts.

	PR tree-optimization/91838
	* gimple-match-head.cc: Include attribs.h and asan.h.
	* generic-match-head.cc: Likewise.
	* match.pd (([rl]shift @0 out-of-bounds) -> zero): New pattern.
parent a426b91b
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