On Thu, 6 Nov 2025 at 14:49, Richard Henderson
<[email protected]> wrote:
>
> Currently an unpredictable movw such as
>
> movw pc, 0x123
>
> results in the tinycode
>
> and_i32 $0x123,$0x123,$0xfffffffc
> mov_i32 pc,$0x123
> exit_tb $0x0
>
> which is clearly a bug, writing to a constant is incorrect and discards
> the result of the mask. Fix this by adding a temporary in store_reg().
>
> Signed-off-by: Anton Johansson <[email protected]>
> [rth: Avoid an extra temp and extra move.]
> Signed-off-by: Richard Henderson <[email protected]>
> ---
Applied to target-arm.next, thanks; tweaked the commit
message to match the code:
which is clearly a bug: writing to a constant is incorrect and
discards the result of the mask. Fix this by always doing an and_i32
and trusting the optimizer to turn this into a simple move when the
mask is zero.
-- PMM