https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101720
--- Comment #1 from David Binderman <dcb314 at hotmail dot com> --- Strangely, changing the -O2 to -O3 and dropping the -g changes the time to 3 minutes 49 seconds, so -g looks to be the culprit. The source code is 5.9 Megs, the gcc build is a release build and the test machine runs at 4.1GHz, so not a slow machine.