Dead gnulibers, In Bison, the core algorithms of the computation of the parsing tables heavily use bitsets and arrays of bitsets. Initially Bison used its own routines for bitset manipulation (actually, a lot was done by hand, without any abstraction), but at some point I saw a very nice submission from Michael Hayes on the GCC lists for a fully featured lib on bitsets. (https://gcc.gnu.org/ml/gcc/2002-01/msg00825.html).
I don't know whether it finally made it in GCC (https://gcc.gnu.org/ml/gcc/2002-05/msg01564.html), but it was included in Bison, and we maintained it over the years (mostly modernizing). I think it should move to gnulib: it's way more powerful than what we use in Bison only. Paul already reported he would be interested in using this module in Emacs. This library is very flexible and implements several backends, depending on the expected use (whether dense/sparse, fixed/dynamic, etc.). The headers are largely commented; but I have written a short doc so that the reader can get at least a sense of how to use this library. Cheers!