-
Notifications
You must be signed in to change notification settings - Fork 19k
cmd/compile: redundant conditional jump #29853
Copy link
Copy link
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone 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.Issues related to the Go compiler and/or runtime.
Milestone
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone 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.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Done
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.