cmd/compile: flagalloc doesn't delete dead instructions #65039
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
Go version
go version devel go1.22-b7c630dc3a Tue Jan 9 01:36:54 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Compile https://go.dev/play/p/4RMX7fsEHw9
What did you see happen?
The generated assembly contains a dead TESTQ instruction at 0x0005
What did you expect to see?
CMOVQNE at 0x001e uses ZF set by
TESTQ AX, CX
. The ZF set by TESTQ at 0x0005 gets immediately clobbered by the BSRQ that follows. flagalloc inserts a second TESTQ at 0x001b, but doesn't clean up the old TESTQ, which is now dead.The text was updated successfully, but these errors were encountered: