From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58E7E385500D; Tue, 29 Jun 2021 19:00:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58E7E385500D From: "ian at airs dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/101064] long compile time in var_tracking for Go package Date: Tue, 29 Jun 2021 19:00:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: ian at airs dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jun 2021 19:00:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101064 --- Comment #5 from Ian Lance Taylor --- I have attached a C test case that demonstrates the problem. The C case ma= y 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 ca= se (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 ba= sic blocks. Perhaps it also needs a fast exit for functions that are very long even if they don't have many basic blocks.=