https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110489
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:18e5aeaef294428fc8458c2c70a9ac3a537c35d6 commit r14-2209-g18e5aeaef294428fc8458c2c70a9ac3a537c35d6 Author: Richard Biener <rguent...@suse.de> Date: Fri Jun 30 09:46:48 2023 +0200 middle-end/110489 - avoid useless work on statistics When we call statistics_fini_pass we unconditionally allocate the statistics hash and traverse it. When a TU has many small functions this can take considerable time. The following avoids this by never allocating the hash from this function. PR middle-end/110489 * statistics.cc (curr_statistics_hash): Add argument indicating whether we should allocate the hash. (statistics_fini_pass): If the hash isn't allocated only print the summary header.