This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [bitmap]: tidy and remove unused function
- From: Richard Henderson <rth at redhat dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 10 Nov 2004 10:22:29 -0800
- Subject: Re: [bitmap]: tidy and remove unused function
- References: <418FADC7.4080204@codesourcery.com>
On Mon, Nov 08, 2004 at 05:32:55PM +0000, Nathan Sidwell wrote:
> * bitmap.h (nBITMAP_WORD_BITS): Remove.
> (BITMAP_WORD_BITS): Force unsigned by use of 1u.
> (BITMAP_ELEMENT_WORDS, BITMAP_ELEMENT_ALL_BITS): Remove
> unnecessary casts.
> (bitmap_first_set_bit): Return unsigned.
> (bitmap_last_set_bit): Remove.
> * bitmap.c (bitmap_element_zerop, bitmap_copy): Make iterator
> unsigned.
> (bitmap_first_set_bit): Return unsigned, require non-empty bitmap,
> remove special case code for two word elements.
> (bitmap_last_set_bit): Remove.
> * ra-build.c (livethrough_conflicts_bb): Replace unnecessary use of
> bitmap_first_set_bit with bitmap_empty_p.
> * tree-outof-ssa.c (analyze_edges_for_bb): Likewise.
> * tree-ssa-pre.c (bitmap_print_value): Use simple flag rather than
> bitmap_last_bit_set.
Ok.
> /* Binary search for the first set bit. */
> /* ??? It'd be nice to know if ffs or ffsl was available. */
Given that you know that word is non-zero,
#ifdef GCC_VERSION >= 3004
gcc_assert (sizeof (word) == sizeof(unsigned long));
bit_num += __builtin_ctzl (word);
#else
...
#endif
r~