Skip to content

cmd/compile go:noinline misuse in TestAssembly #22208

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

Closed
huguesb opened this issue Oct 11, 2017 · 2 comments
Closed

cmd/compile go:noinline misuse in TestAssembly #22208

huguesb opened this issue Oct 11, 2017 · 2 comments

Comments

@huguesb
Copy link
Contributor

huguesb commented Oct 11, 2017

A pragma is placed before a closure and does not appear in the AST (at least not in the corresponding ODCLFUNC node)

func f72(a, b int) int {
  //go:noinline
  func() {_, _ = a, b} () // use some frame
  return b
}

This test currently passes because calls to closures are never inlined but this will change soon.
See #15561 and https://go-review.googlesource.com/c/go/+/65071

Should go:noinline be supported for closures? If so the scanner needs to be fixed. Otherwise the test needs to be updated.

@randall77
Copy link
Contributor

I don't think we should support go:noinline for closures. go:noinline is basically only for tests of Go itself, and we can always work around its restrictions.
f72 (and f13 in that same file) can probably get away with just calling runtime.GC() instead of the closure. The offsets might need to be adjusted.
@cherrymui @mundaym

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/73211 mentions this issue: cmd/compile: Fix incorrect go:noinline usage

@golang golang locked and limited conversation to collaborators Oct 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants