https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117091
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andi Kleen from comment #6) > There are multiple issues (should probably rename the subject) > > Apart from the inefficient bit test, the jump_table clustering is also very > inefficient because it tries every possible cluster combination > > unsigned l = clusters.length (); > ... > for (unsigned i = 1; i <= l; i++) > { > ... > > for (unsigned j = 0; j < i; j++) > > There must be a better algorithm for this? Perhaps it needs dynamic > programming? But IIRC there's a limit on clusters.length ()? If not we should add one. > Also in addition the function that creates the tree is recursive and can > have quite deep recursion (should probably fix that one too) > > >I wouldn't start with disabling this at -O0 and -O1 ;) > > Even with a better algorithm that's imho the right thing to do. I agree for -O0, but still bad compile-time is bad compile-time, even when it's -O2 or -O3.