We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Noticed a case where compiler produces a repeated sequence of XCHGL AX, AX.
XCHGL AX, AX
https://go.godbolt.org/z/_yJaga
go version
$ go version go version go1.14.1 windows/amd64
But also happens on
go1.13.9
go version devel +e31d741801 Fri Apr 3 17:51:12 2020 +0000 windows/amd64
Compiling https://play.golang.org/p/HfxglRpLB4A with go tool compile -S shows that the output contains a sequence:
go tool compile -S
0x008c 00140 ($GOROOT\src\io\io.go:329) CALL io.ReadAtLeast(SB) 0x0091 00145 ($GOROOT\src\io\io.go:329) CMPQ 56(SP), $0 0x0097 00151 (main.go:10) JEQ 169 0x0099 00153 (main.go:11) PCDATA $0, $-1 0x0099 00153 (main.go:11) PCDATA $1, $-1 0x0099 00153 (main.go:11) MOVQ 144(SP), BP 0x00a1 00161 (main.go:11) ADDQ $152, SP 0x00a8 00168 (main.go:11) RET 0x00a9 00169 (main.go:16) XCHGL AX, AX 0x00aa 00170 (main.go:19) XCHGL AX, AX 0x00ab 00171 (main.go:22) XCHGL AX, AX 0x00ac 00172 (main.go:25) XCHGL AX, AX 0x00ad 00173 (main.go:28) XCHGL AX, AX 0x00ae 00174 (main.go:31) XCHGL AX, AX 0x00af 00175 (main.go:34) XCHGL AX, AX 0x00b0 00176 (main.go:37) XCHGL AX, AX 0x00b1 00177 ($GOROOT\src\encoding\binary\binary.go:78) PCDATA $0, $1 0x00b1 00177 ($GOROOT\src\encoding\binary\binary.go:78) PCDATA $1, $3 0x00b1 00177 ($GOROOT\src\encoding\binary\binary.go:78) MOVQ ""..autotmp_80+136(SP), AX
I would expect that a single XCHGL AX, AX is sufficient.
The text was updated successfully, but these errors were encountered:
It seems these are generated due to InlMark and are left together after "lowered deadcode for cse" pass.
InlMark
Possibly related #29571
Sorry, something went wrong.
Those are just the inline marks. We need so many because each represents a different inlining at a different source line.
Yes, this is a dup of #29571.
There are things we could do here, like put the inline marks out-of-line. But let's discuss that over at #29571.
No branches or pull requests
Noticed a case where compiler produces a repeated sequence of
XCHGL AX, AX
.https://go.godbolt.org/z/_yJaga
What version of Go are you using (
go version
)?But also happens on
go1.13.9
andgo version devel +e31d741801 Fri Apr 3 17:51:12 2020 +0000 windows/amd64
What did you see?
Compiling https://play.golang.org/p/HfxglRpLB4A with
go tool compile -S
shows that the output contains a sequence:I would expect that a single
XCHGL AX, AX
is sufficient.The text was updated successfully, but these errors were encountered: