]> gcc.gnu.org Git - gcc.git/commit
MATCH: Fix PR 109834, ICE with popcount combined with bswap
authorAndrew Pinski <apinski@marvell.com>
Fri, 12 May 2023 23:33:44 +0000 (16:33 -0700)
committerAndrew Pinski <apinski@marvell.com>
Sat, 13 May 2023 03:10:19 +0000 (20:10 -0700)
commit99488a6048745a7b999c22f46e5814d02ebf88d9
tree70c4e859f73f651d4c204359ef2c1b587f44a5c2
parent20ca33db817cecb11661caad4a90c0aeced9130b
MATCH: Fix PR 109834, ICE with popcount combined with bswap

After r14-673-gc0dd80e4c4c3, there was a check in the match
patterns which was checking the type is unsigned but
instead of using the type, the patch used the expression.
This adds the needed TREE_TYPE so get the correct answer and don't ICE.

Committed as obvious after a bootstrap/test on x86_64-linux-gnu.

PR tree-optimization/109834

gcc/ChangeLog:

* match.pd (popcount(bswap(x))->popcount(x)): Fix up unsigned type checking.
(popcount(rotate(x,y))->popcount(x)): Likewise.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr109834-1.c: New test.
* gcc.dg/tree-ssa/pr109834-1.c: New test.
gcc/match.pd
gcc/testsuite/gcc.c-torture/compile/pr109834-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr109834-1.c [new file with mode: 0644]
This page took 0.075223 seconds and 6 git commands to generate.