* fold-const.c (tree_nonzero_bits): New function.
commitd1f6ca14093c960f3df650f4be9398744e13db8b
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 May 2018 20:47:03 +0000 (24 20:47 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 May 2018 20:47:03 +0000 (24 20:47 +0000)
tree4a8896b5cc8eb4200c03939215754c0b775e381e
parent4d5038dd20f2f57b520035242dbb0fcad598c4c6
    * fold-const.c (tree_nonzero_bits): New function.
        * fold-const.h (tree_nonzero_bits): Likewise.
        * match.pd (POPCOUNT): New patterns to fold BUILTIN_POPCOUNT and
        friends.  POPCOUNT(x&1) => x&1, POPCOUNT(x)==0 => x==0, etc.

        * gcc.dg/fold-popcount-1.c: New testcase.
        * gcc.dg/fold-popcount-2.c: New testcase.
        * gcc.dg/fold-popcount-3.c: New testcase.
        * gcc.dg/fold-popcount-4.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260689 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/fold-const.h
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fold-popcount-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-popcount-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-popcount-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-popcount-4.c [new file with mode: 0644]