https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91725
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 46866 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46866&action=edit gcc10-pr91725.patch Yet another untested patch, tree_nonzero_bits is something that already does what you write above, just doesn't cope with vector types (as it uses TYPE_PRECISION rather than element_precision). But, get_nonzero_bits isn't really useful on vector types anyway, for SSA_NAMEs we don't track the non-zero bits and for VECTOR_CSTs we'd need to test all elements and or the bits together.