Skip to content
Snippets Groups Projects
Commit 452c4f32 authored by Andrew Pinski's avatar Andrew Pinski
Browse files

match: Fix the `popcnt(a&b) + popcnt(a|b)` pattern for types [PR111913]

So this pattern needs a little help on the gimple side of things to know what
the type popcount should be. For most builtins, the type is the same as the input
but popcount and others are not. And when using it with another outer expression,
genmatch needs some slight help to know that the return type was type rather than
the argument type.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

	PR tree-optimization/111913

gcc/ChangeLog:

	* match.pd (`popcount(X&Y) + popcount(X|Y)`): Add the resulting
	type for popcount.

gcc/testsuite/ChangeLog:

	* gcc.c-torture/compile/fold-popcount-1.c: New test.
	* gcc.dg/fold-popcount-8a.c: New test.
parent 3e901615
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