https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101064
--- Comment #5 from Ian Lance Taylor <ian at airs dot com> --- I have attached a C test case that demonstrates the problem. The C case may be somewhat worse because I had to use ordinary variables, whereas the Go test case is used compiler-generated temporary variables. When I compiled the C test case with mainline GCC with "-g -O2" on my laptop the compilation takes 20 minutes, and according to -ftime-report 91% of that time is spent on var-tracking: var-tracking dataflow : 541.98 ( 44%) 0.02 ( 2%) 542.26 ( 44%) 1288k ( 0%) var-tracking emit : 575.86 ( 47%) 0.04 ( 4%) 576.31 ( 47%) 3125k ( 0%) This test case is, of course, generated code, as is the original Go test case (the generated Go code is https://go.googlesource.com/go/+/refs/heads/master/src/cmd/internal/obj/x86/avx_optabs.go). The var-tracking pass already has a fast exit for functions with lots of basic blocks. Perhaps it also needs a fast exit for functions that are very long even if they don't have many basic blocks.