diff options
author | Andrew Pinski <apinski@marvell.com> | 2022-11-02 15:56:31 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2022-12-21 18:32:26 +0000 |
commit | 193fccaa5c3525e979a989835c47c76d2c49d10c (patch) | |
tree | 09f58b9f53e9287c91aa6a4eeb8a8ecf9a497b70 /gcc/tree-ssa-phiopt.cc | |
parent | 91e0d22025e0bf2af2e364cb7214a05512a0c431 (diff) | |
download | gcc-193fccaa5c3525e979a989835c47c76d2c49d10c.zip gcc-193fccaa5c3525e979a989835c47c76d2c49d10c.tar.gz gcc-193fccaa5c3525e979a989835c47c76d2c49d10c.tar.bz2 |
Fix PR 105532: match.pd patterns calling tree_nonzero_bits with vector types
Even though this PR was reported with an ubsan issue, the problem is
tree_nonzero_bits is being called with an expression which is a vector type.
This fixes three patterns I noticed which does that.
And adds a testcase for one of the patterns.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions
gcc/ChangeLog:
PR tree-optimization/105532
* match.pd (~(X >> Y) -> ~X >> Y): Check if it is an integral
type before calling tree_nonzero_bits.
(popcount(X) + popcount(Y)): Likewise.
(popcount(X&C1)): Likewise.
gcc/testsuite/ChangeLog:
* gcc.c-torture/compile/vector-shift-1.c: New test.
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
0 files changed, 0 insertions, 0 deletions