https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69347
--- Comment #16 from David Binderman <dcb314 at hotmail dot com> --- I tried the original code with gcc trunk dated 20160125 and compilation time with -O2 and compiler built with --enable-checking=yes is now downto about 100 seconds. AFAIK, problem solved.