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
cmd/compile: compile failure building kubernetes #15071
Comments
It's now trying to inline switches (the point of the offending CL), but it doesn't know how to inline the fallthrough in // Neg sets q to the negative value of y.
// It updates the format of q to match y.
func (q *Quantity) Neg(y Quantity) error {
switch {
case y.Amount == nil:
*q = y
case q.Amount == nil:
q.Amount = &inf.Dec{}
fallthrough
default:
q.Amount.Neg(y.Amount)
q.Format = y.Format
}
return nil
} Removing the fallthrough makes it compile. Marking fallthrough as hairy fixes it, but means that switch can no longer be inlined: diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go
index c21af77..230eb43 100644
--- a/src/cmd/compile/internal/gc/inl.go
+++ b/src/cmd/compile/internal/gc/inl.go
@@ -215,6 +215,7 @@ func ishairy(n *Node, budget *int) bool {
OFOR,
OSELECT,
OTYPESW,
+ OXFALL,
OPROC,
ODEFER,
ODCLTYPE, // can't print yet |
Please notify me of the fix so I can update the corresponding binary exporter as well. Or leave fallthrough as "hairy" and wait until we switch over to binary format (soon-ish, code is working but needs to be reviewed and checked in.) |
@griesemer @bradfitz thanks for the fix, I've verified it works and gets k8s building at tip again. I think it's a reasonable fix. I'll send a CL unless someone beats me to it this afternoon. |
I've got a fix and unit test, but I'm in the middle of moving houses and my primary machine is still packed up. It's taking forever to run tests on this Macbook...
|
@tzneal Thanks. |
CL https://golang.org/cl/21452 mentions this issue. |
I haven't bisected yet, this is a recent (within the last month) failure.
/cc @josharian @mdempsky
The text was updated successfully, but these errors were encountered: