https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97229
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> --- I've got a hackish patch that tries to resolve that. Basically, linear iteration of globals is very slow and a better data structure should be used (I used sorted list), so each lookup is at least O(log N). I'm going to report that to upstream.