Join GitHub today
cmd/compile: internal compiler error: panic during lower #29215
The following program
crashes the tip compiler with:
It compiles fine on go1.11.
This is a weird dead code situation. Basically we have
The compiler realizes that the branch is never taken. And it constant folds
The easy fix is to just check for and ignore out-of-bounds errors in the rewrite rule. That bounds check was a nice sanity check, but dead code is insane.
A bigger fix is another deadcode pass before lowering. I don't want to go there for this issue.