diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2018-05-24 20:47:03 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-05-24 14:47:03 -0600 |
commit | ba6557e2686306942b157c3350e7497e551afb80 (patch) | |
tree | 4a8896b5cc8eb4200c03939215754c0b775e381e /gcc/fold-const.h | |
parent | 520fe2e324da4b1aa2c1fbac29741bd45afa98c1 (diff) |
fold-const.c (tree_nonzero_bits): New function.
* 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.
From-SVN: r260689
Diffstat (limited to 'gcc/fold-const.h')
-rw-r--r-- | gcc/fold-const.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fold-const.h b/gcc/fold-const.h index 8e3ad512a0b..337818a3319 100644 --- a/gcc/fold-const.h +++ b/gcc/fold-const.h @@ -181,6 +181,7 @@ extern tree const_unop (enum tree_code, tree, tree); extern tree const_binop (enum tree_code, tree, tree, tree); extern bool negate_mathfn_p (combined_fn); extern const char *c_getstr (tree, unsigned HOST_WIDE_INT *strlen = NULL); +extern wide_int tree_nonzero_bits (const_tree); /* Return OFF converted to a pointer offset type suitable as offset for POINTER_PLUS_EXPR. Use location LOC for this conversion. */ |