On 9/29/26 23:53, Matt Turner wrote:
+void tcg_gen_subi(TCGType type, TCGTemp *dst, TCGTemp *src1, int64_t src2)
+{
+    tcg_gen_addi(type, dst, src1, -src2);

Double check me on this, but since src2's type changed from int32_t to
int64_t, I think this will produce a value that isn't sign-extended
for I32.

E.g. for I32 with src2 == INT32_MIN this now produces 0x80000000
rather than the 0xffffffff80000000 the old code produced.
tcg_constant_internal() doesn't canonicalize, so we end up with an I32
constant that isn't sign-extended, which optimize.c assumes can't
happen.
Hmm. I was just about to say that it'll be re-extended when creating the TEMP_CONST in tcg_constant_internal, but that turns out not to be the case.

I'll fix it there.  Thanks for noticing.


r~

Reply via email to