]> git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: Fix zero_one_valued_p not to match signed 1 bit integers
authorAndrew Pinski <apinski@marvell.com>
Thu, 8 Jun 2023 21:25:51 +0000 (14:25 -0700)
committerAndrew Pinski <apinski@marvell.com>
Fri, 9 Jun 2023 14:09:15 +0000 (07:09 -0700)
commit72e652f3425079259faa4edefe1dc571f72f91e0
tree69e2c837b7f794e70562b9921a5cad94e7ba05ec
parent45b7da5f4951c3e9e5187487d611d16ff8cf148f
MATCH: Fix zero_one_valued_p not to match signed 1 bit integers

So for the attached testcase, we assumed that zero_one_valued_p would
be the value [0,1] but currently zero_one_valued_p matches also
signed 1 bit integers.
This changes that not to match that and fixes the 2 new testcases at
all optimization levels.

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

Note the GCC 13 patch will be slightly different due to the changes
made to zero_one_valued_p.

PR tree-optimization/110165
PR tree-optimization/110166

gcc/ChangeLog:

* match.pd (zero_one_valued_p): Don't accept
signed 1-bit integers.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr110165-1.c: New test.
* gcc.c-torture/execute/pr110166-1.c: New test.
gcc/match.pd
gcc/testsuite/gcc.c-torture/execute/pr110165-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr110166-1.c [new file with mode: 0644]