]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/91838 - fix FAIL of g++.dg/opt/pr91838.C
authorRichard Biener <rguenther@suse.de>
Thu, 27 Jul 2023 11:08:32 +0000 (13:08 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 27 Jul 2023 13:55:18 +0000 (15:55 +0200)
commitd1c072a1c3411a6fe29900750b38210af8451eeb
tree1be2c459b42d23ba8214bcaae402ffe2ecc3ccc7
parenta426b91b27e28985f47d16827a532fbc28c09bd7
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.
gcc/generic-match-head.cc
gcc/gimple-match-head.cc
gcc/match.pd
This page took 0.061777 seconds and 5 git commands to generate.