Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: infinite loop in -m=2 #35518
This compilation unit goes into an infinite loop when compiled with
Distilled from cmd/compile/internal/gc, pointed out by @dr2chase .
Go 1.13 didn't print anything useful about why these variables were heap allocated, so I don't think it's release critical that Go 1.14 print anything useful for them either. But it is release critical to not infinite loop compiling with -m=2.
Properly handling loops like this will require a bit more restructuring to the walk code, which I don't feel comfortable doing this late in the release. I'm inclined to simply detect that we've hit a loop, print a warning that the path is incomplete, and return. We can figure out how to better diagnose these rho-shaped loops in Go 1.15.
And finally, here's an example where the original node isn't part of the assignment cycle:
Context: I was wondering if CL 206619 was overkill, and I could just check if we loop back to
This CL detects infinite loops due to negative dereference cycles during escape analysis, and terminates the loop gracefully. We still fail to print a complete explanation of the escape path, but esc.go didn't print *any* explanation for these test cases, so the release blocking issue here is simply that we don't infinite loop. Updates #35518. Change-Id: I39beed036e5a685706248852f1fa619af3b7abbc Reviewed-on: https://go-review.googlesource.com/c/go/+/206619 Run-TryBot: Matthew Dempsky <email@example.com> Reviewed-by: Brad Fitzpatrick <firstname.lastname@example.org> Reviewed-by: David Chase <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org>