https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105028
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:b3eb889978c6a28961511bd70f3cc177df54fde7 commit r11-9781-gb3eb889978c6a28961511bd70f3cc177df54fde7 Author: Richard Biener <rguent...@suse.de> Date: Wed Mar 23 12:21:32 2022 +0100 rtl-optimization/105028 - fix compile-time hog in form_threads_from_copies form_threads_from_copies processes a sorted array of copies, skipping those with the same thread and conflicting threads and merging the first non-conflicting ones. After that it terminates the loop and gathers the remaining elements of the array, skipping same thread copies, re-starting the process. For a large number of copies this gathering of the rest takes considerable time and it also appears pointless. The following simply continues processing the array which should be equivalent as far as I can see. This takes form_threads_from_copies off the profile radar from previously taking ~50% of the compile-time. 2022-03-23 Richard Biener <rguent...@suse.de> PR rtl-optimization/105028 * ira-color.c (form_threads_from_copies): Remove unnecessary copying of the sorted_copies tail. (cherry picked from commit 1daa198aafd72925ca8dd8616385f523ff180d4a)