Closed
Description
What version of Go are you using (go version
)?
go tip
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
go env
Output
Darwin AMD64
What did you do?
Looked at the assembly code of runtime.adjustframe.
What did you expect to see?
movl $1, %eax
movq 128(%rsp), %rbp
addq $136, %rsp
retq
I expected to see this once since there's a ret.
What did you see instead?
movl $1, %eax
movq 128(%rsp), %rbp
addq $136, %rsp
retq
movl $1, %eax
movq 128(%rsp), %rbp
addq $136, %rsp
retq
movl $1, %eax
movq 128(%rsp), %rbp
addq $136, %rsp
retq
Perhaps I am missing something and there's a valid reason for this, but it seems to me that we could use this sequence once and save 40+ bytes of instructions. Not sure if it's occuring anywhere else.