Prepare for more direct uses of tcg_constant_internal, where
canonicalization of 32-bit constants is not already assured.

Signed-off-by: Richard Henderson <[email protected]>
---
 tcg/tcg.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index c3fdcfbe68..1cd6d41d31 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2257,6 +2257,10 @@ TCGTemp *tcg_constant_internal(TCGType type, int64_t val)
         s->const_table[type] = h;
     }
 
+    if (type == TCG_TYPE_I32) {
+        val = (int32_t)val;
+    }
+
     ts = g_hash_table_lookup(h, &val);
     if (ts == NULL) {
         ts = tcg_temp_alloc(s);
-- 
2.53.0


Reply via email to