I tried to build this program with -gcflags='-d "ssa/opt/debug=2"'
What did you expect to see?
What did you see instead?
$ go build -gcflags='-d "ssa/opt/debug=2"'
opt: rewriting for f
rewriting v13 = Convert <unsafe.Pointer> v12 v1 -> v13 = AddPtr <unsafe.Pointer> v7 v8
./a.go:6:56: internal compiler error: 'f': rewrite cycle detected
Please file a bug report including a short program that triggers the error.
I investigated the cause of this issue.
it only rewrote rewriting v13 = Convert <unsafe.Pointer> v12 v1 -> v13 = AddPtr <unsafe.Pointer> v7 v8 on the 1st step.
and then calculate the hash of this function, store it to the states.
on the 2nd step, it only proceeded to remove dead values.