https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109983
--- Comment #7 from Sergei Trofimovich <slyfox at gcc dot gnu.org> --- Original packet-rnsap.c.i.xz takes 27 minutes to compile for me. The hack below cuts this time down to 9 minutes (slashes 60% of runtime). The considerable amount of time is spent looking up the bitmaps for graph edges to extract and solve PT facts. I'd say there is a room for micro-optimization to turn bitmap to something slightly smarter than a linked list. It will not improve the runtime too much. Another option could be to put a limit on edge count (say, controlled by a `param`) which `gcc` could use to fallback on conservative value. --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -283,7 +283,7 @@ typedef unsigned long BITMAP_WORD; /* Number of words to use for each element in the linked list. */ #ifndef BITMAP_ELEMENT_WORDS -#define BITMAP_ELEMENT_WORDS ((128 + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS) +#define BITMAP_ELEMENT_WORDS ((8192 + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS) #endif /* Number of bits in each actual element of a bitmap. */