From ba6557e2686306942b157c3350e7497e551afb80 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Thu, 24 May 2018 20:47:03 +0000 Subject: 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 --- gcc/fold-const.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fold-const.h') diff --git a/gcc/fold-const.h b/gcc/fold-const.h index 8e3ad51..337818a 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. */ -- cgit v1.1