Skip to content

cmd/compile: nil check not removed for Zero/Copy on some architectures #18003

@cherrymui

Description

@cherrymui

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions