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: nil check not removed for Zero/Copy on some architectures #18003

Closed
cherrymui opened this issue Nov 21, 2016 · 2 comments
Closed
Milestone

Comments

@cherrymui
Copy link
Member

What version of Go are you using (go version)?

tip (0bae74e)

What operating system and processor architecture are you using (go env)?

AMD64

Compile this code:

type T struct {
        a, b, c, d, e, f, g, h int
}

func f(t *T) T {
        return *t
}

The nil check in f is not removed:

v6 = Arg <*T> {t}
v10 = LoweredNilCheck <void> v6 v9
v12 = VarDef <mem> {~r1} v9
v13 = DUFFCOPY <mem> [840] v7 v6 v12

It is because some Zero/Move ops are not marked as faultOnNilArg0 etc. Will send a fix.

@cherrymui cherrymui self-assigned this Nov 21, 2016
@gopherbot
Copy link

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

@bradfitz
Copy link
Contributor

Unless this is a regression from Go 1.7, I'm targeting this as Go 1.9.

@bradfitz bradfitz added this to the Go1.9 milestone Nov 21, 2016
@golang golang locked and limited conversation to collaborators Feb 2, 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