-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: unexpected panic introduced with c08b01e #25776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the bisect. |
I'm looking at this, I suspect but am not sure it is some latent bug tickled by changes to panic-inlining. |
FYI, longer but self-contained reproducer (and not-reproducer). It's delicate:
The inlined switch is rewritten incorrectly in
|
Change https://golang.org/cl/118318 mentions this issue: |
Change https://golang.org/cl/154497 mentions this issue: |
When a println arg contains a call to an inlineable function that itself contains a switch, that switch statement will be walked twice, once by the walkexprlist formerly in the OPRINT/OPRINTN case, then by walkexprlistcheap in walkprint. Remove the first walkexprlist, it is not necessary. walkexprlist = s[i] = walkexpr(s[i], init) walkexprlistcheap = { s[i] = cheapexpr(n, init) s[i] = walkexpr(s[i], init) } Seems like this might be possible in other places, i.e., calls to inlineable switch-containing functions. See also #25776. Fixes #29220. Change-Id: I3781e86aad6688711597b8bee9bc7ebd3af93601 Reviewed-on: https://go-review.googlesource.com/c/154497 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
What version of Go are you using (
go version
)?go version devel +c08b01e Wed Jun 6 20:35:23 2018 +0000 linux/amd64
Does this issue reproduce with the latest release?
Not in latest release. Yes in master e5f0c1f
What operating system and processor architecture are you using (
go env
)?What did you do?
Run the code at https://play.golang.org/p/hr84SxOns8y
I have attempted to produce a smaller reproducer that does not depend on gonum/mat without success.
What did you expect to see?
No output.
What did you see instead?
Additional information
Gonum version used is gonum/gonum@438fe0c.
Bisected to Go commit c08b01e.
Original ref gonum/gonum#522.
/cc @dr2chase
The text was updated successfully, but these errors were encountered: