Skip to content

cmd/compile: redundant conditional jump #29853

@mariecurried

Description

@mariecurried

What did you do?

Hello. I was writing some code and decided to inspect the assembly instructions generated from it.
https://godbolt.org/z/zFjGRF

What did you expect to see?

I was expecting to see no redundant instructions.

What did you see instead?

There is a redundant conditional jump on line 31.
It is redundant, because the jump from line 24 to 31 happens if AX != 0 (that is, err is != nil). But on line 31, the conditional jump tests if AX == 0, which is never true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions