{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/13901","labels_url":"https://api.github.com/repos/golang/go/issues/13901/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/13901/comments","events_url":"https://api.github.com/repos/golang/go/issues/13901/events","html_url":"https://github.com/golang/go/issues/13901","id":125847460,"number":13901,"title":"cmd/compile: spurious writebarriers emitted for global funcs","user":{"login":"DanielMorsing","id":545573,"avatar_url":"https://avatars.githubusercontent.com/u/545573?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielMorsing","html_url":"https://github.com/DanielMorsing","followers_url":"https://api.github.com/users/DanielMorsing/followers","following_url":"https://api.github.com/users/DanielMorsing/following{/other_user}","gists_url":"https://api.github.com/users/DanielMorsing/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielMorsing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielMorsing/subscriptions","organizations_url":"https://api.github.com/users/DanielMorsing/orgs","repos_url":"https://api.github.com/users/DanielMorsing/repos","events_url":"https://api.github.com/users/DanielMorsing/events{/privacy}","received_events_url":"https://api.github.com/users/DanielMorsing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-10T21:35:56Z","updated_at":"2016-01-10T21:35:56Z","closed_at":null,"body":"gc emits write barriers when a global function is assigned, even though it is unnecessary\r\n\r\nreproducer:\r\n```\r\npackage foo\r\n\r\ntype t struct {\r\n\tx func() *t\r\n}\r\n\r\nfunc f() *t {\r\n\tg := new(t)\r\n\tg.x = f\r\n\treturn g\r\n}\r\n```\r\nBuilt with `go build -gcflags '-d wb' blah.go`, outputs `./blah.go:9: write barrier`\r\n\r\nI don't think there is any correctness issues with emitting the WB and I doubt the performance suffers for it, but I did get a spurious warning when doing some runtime dev."}}