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.
Run-TryBot: Eric Fang <email@example.com>
Reviewed-by: Cherry Mui <firstname.lastname@example.org>
TryBot-Result: Gopher Robot <email@example.com>
Reviewed-by: Keith Randall <firstname.lastname@example.org>