You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling this program with -S for arm64 has the line:
CMPW $184683593771, R1
It should be
CMPW $43, R1
Note that 184683593771 = 43<<32 + 43.
Go 1.16 is ok, this started in Go 1.17. Bisect points to https://go-review.googlesource.com/c/go/+/289649 . It looks maybe intentional? Not sure, but definitely weird.
The actual machine code looks correct. Builders are passing, and go tool objdump shows the right disassembly. It's just the -S output that appears broken.
This problem has existed for a long time, but CL 289649 exposed it. The root cause is that we modified this constant operand in progedit by copying the lower 32 bits to the upper 32 bits.
We modify this constant just to determine whether it is a C_BITCON class and to encode it as a C_BITCON. So maybe we can do this modification (copy the lower 32 bits to the upper 32 bits) just before these two operations (con32class and bitconEncode ), and assign it to a temporary variable, so that the print result will not be modified.
For some 32-bit instructions whose first operand is a constant, we
copy the lower 32 bits of the constant into the upper 32 bits in progedit,
which leads to the wrong value being printed in -S output.
The purpose of this is that we don't need to distinguish between 32-bit
and 64-bit constants when checking C_BITCON, this CL puts the modified
value in a temporary variable, so that the constant operand of the
instruction will not be modified.
Fixesgolang#53551
Change-Id: I40ee9223b4187bff1c0a1bab7eb508fcb30325f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/414374
Run-TryBot: Eric Fang <eric.fang@arm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Compiling this program with
-S
forarm64
has the line:It should be
Note that
184683593771 = 43<<32 + 43
.Go 1.16 is ok, this started in Go 1.17. Bisect points to https://go-review.googlesource.com/c/go/+/289649 . It looks maybe intentional? Not sure, but definitely weird.
The actual machine code looks correct. Builders are passing, and
go tool objdump
shows the right disassembly. It's just the-S
output that appears broken.@cherrymui @erifan
The text was updated successfully, but these errors were encountered: