Constant propogation wrongly calcuates the value after certain rol
instructions
#4252
Labels
Component: Core
Issue needs changes to the core
Effort: Trivial
Issue should take < 1 day
Impact: Low
Issue is a papercut or has a good, supported workaround
Type: Bug
Issue is a non-crashing bug with repro steps
Milestone
In the following code,
the value of
eax
should be0x172b6a7e
after therol
instruction. However, the constant propagation thinks its value is 0x0 (see thesub_0
annotation).Another example:
0x2c is
0b101100
. When we try to calculate its value and shift right, since BN is 64 bit, we will shift the input value, 0x8406fb4b, 0x2c times. However, in the real CPU it will only shift 0b1100 (12) times. This causes the result to be different.This is actually quite subtle. We only get the value wrong when the target is 32 bit, and the shift count is different when truncated to its lowest 5 or 6 bits
The text was updated successfully, but these errors were encountered: