Skip to content
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/internal/ssa: rewritegeneric.go out of sync with generic.rules #18885

Closed
mundaym opened this issue Feb 1, 2017 · 1 comment

Comments

@mundaym
Copy link
Member

commented Feb 1, 2017

cfd17f5 modified rewritegeneric.go but did not fully update generic.rules. Running go run *.go in src/cmd/compile/internal/ssa/gen now gives the following diff:

diff --git a/src/cmd/compile/internal/ssa/rewritegeneric.go b/src/cmd/compile/internal/ssa/rewritegeneric.go
index 0fde363..98c221c 100644
--- a/src/cmd/compile/internal/ssa/rewritegeneric.go
+++ b/src/cmd/compile/internal/ssa/rewritegeneric.go
@@ -6526,7 +6526,7 @@ func rewriteValuegeneric_OpNilCheck(v *Value, config *Config) bool {
                return true
        }
        // match: (NilCheck (Load (OffPtr [c] (SP)) mem) mem)
-       // cond: mem.Op == OpStaticCall         && isSameSym(mem.Aux, "runtime.newobject")      && c == config.ctxt.FixedFrameSize() + config.RegSize   && warnRule(config.Debug_checknil() && v.Pos.Line() > 1, v, "removed nil check")
+       // cond: mem.Op == OpStaticCall         && isSameSym(mem.Aux, "runtime.newobject")      && c == config.ctxt.FixedFrameSize() + config.RegSize   && warnRule(config.Debug_checknil() && int(v.Pos) > 1, v, "removed nil check")
        // result: (Invalid)
        for {
                v_0 := v.Args[0]
@@ -6546,14 +6546,14 @@ func rewriteValuegeneric_OpNilCheck(v *Value, config *Config) bool {
                if mem != v.Args[1] {
                        break
                }
-               if !(mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize && warnRule(config.Debug_checknil() && v.Pos.Line() > 1, v, "removed nil check")) {
+               if !(mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize && warnRule(config.Debug_checknil() && int(v.Pos) > 1, v, "removed nil check")) {
                        break
                }
                v.reset(OpInvalid)
                return true
        }
        // match: (NilCheck (OffPtr (Load (OffPtr [c] (SP)) mem)) mem)
-       // cond: mem.Op == OpStaticCall         && isSameSym(mem.Aux, "runtime.newobject")      && c == config.ctxt.FixedFrameSize() + config.RegSize   && warnRule(config.Debug_checknil() && v.Pos.Line() > 1, v, "removed nil check")
+       // cond: mem.Op == OpStaticCall         && isSameSym(mem.Aux, "runtime.newobject")      && c == config.ctxt.FixedFrameSize() + config.RegSize   && warnRule(config.Debug_checknil() && int(v.Pos) > 1, v, "removed nil check")
        // result: (Invalid)
        for {
                v_0 := v.Args[0]
@@ -6577,7 +6577,7 @@ func rewriteValuegeneric_OpNilCheck(v *Value, config *Config) bool {
                if mem != v.Args[1] {
                        break
                }
-               if !(mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize && warnRule(config.Debug_checknil() && v.Pos.Line() > 1, v, "removed nil check")) {
+               if !(mem.Op == OpStaticCall && isSameSym(mem.Aux, "runtime.newobject") && c == config.ctxt.FixedFrameSize()+config.RegSize && warnRule(config.Debug_checknil() && int(v.Pos) > 1, v, "removed nil check")) {
                        break
                }
                v.reset(OpInvalid)
@gopherbot

This comment has been minimized.

Copy link

commented Feb 1, 2017

CL https://golang.org/cl/36032 mentions this issue.

@mundaym mundaym changed the title cmd/compile/internal/ssa: rewritegeneric.go file out of sync cmd/compile/internal/ssa: rewritegeneric.go out of sync with generic.rules Feb 1, 2017
@dsnet dsnet added this to the Go1.9 milestone Feb 1, 2017
@gopherbot gopherbot closed this in 457ac38 Feb 1, 2017
@golang golang locked and limited conversation to collaborators Feb 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.