qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tcg_target_long to pointer conversion?


From: Michael Tokarev
Subject: tcg_target_long to pointer conversion?
Date: Sun, 23 Apr 2023 12:55:51 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

Hi!

This commit:

commit 705ed477d54c5bccf51d924c403a52049586c3d7
Author: Richard Henderson <richard.henderson@linaro.org>
Date:   Wed Oct 28 23:42:12 2020 -0700

    tcg/i386: Support split-wx code generation

contains the following change:

-    diff = arg - ((uintptr_t)s->code_ptr + 7);
+    diff = tcg_pcrel_diff(s, (const void *)arg) - 7;

where arg is of type tcg_target_long.  It looks like this is
the only place in qemu where this type is used as the pointer.

Does it make sense?

This warning is produced when building qemu on x32:

 In file included from tcg/tcg.c:432:
 tcg/i386/tcg-target.c.inc: In function ‘tcg_out_movi_int’:
 tcg/i386/tcg-target.c.inc:1041:30: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
  1041 |     diff = tcg_pcrel_diff(s, (const void *)arg) - 7;

yes, x32 itself isn't a supported target, but it has some
rather unique properties which might catch possible issues.

Thanks,

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]