8929906e21
The dh_alias redirect is intended to handle TCG types as distinguished
from C types. TCG does not distinguish signed int from unsigned int,
because they are the same size. However, we need to retain this
distinction for dh_typecode, lest we fail to extend abi types properly
for the host call parameters.
This bug was detected when running the 'arm' emulator on an s390
system. The s390 uses TCG_TARGET_EXTEND_ARGS which triggers code
in tcg_gen_callN to extend 32 bit values to 64 bits; the incorrect
sign data in the typemask for each argument caused the values to be
extended as unsigned values.
This simple program exhibits the problem:
static volatile int num = -9;
static volatile int den = -5;
int main(void)
{
int quo = num / den;
printf("num %d den %d quo %d\n", num, den, quo);
exit(0);
}
When run on the broken qemu, this results in:
num -9 den -5 quo 0
The correct result is:
num -9 den -5 quo 1
Fixes:
|
||
---|---|---|
.. | ||
user | ||
address-spaces.h | ||
confidential-guest-support.h | ||
cpu_ldst.h | ||
cpu-all.h | ||
cpu-common.h | ||
cpu-defs.h | ||
cputlb.h | ||
exec-all.h | ||
gdbstub.h | ||
gen-icount.h | ||
helper-gen.h | ||
helper-head.h | ||
helper-proto.h | ||
helper-tcg.h | ||
hwaddr.h | ||
ioport.h | ||
log.h | ||
memattrs.h | ||
memop.h | ||
memopidx.h | ||
memory_ldst_cached.h.inc | ||
memory_ldst_phys.h.inc | ||
memory_ldst.h.inc | ||
memory-internal.h | ||
memory.h | ||
page-vary.h | ||
plugin-gen.h | ||
poison.h | ||
ram_addr.h | ||
ramblock.h | ||
ramlist.h | ||
softmmu-semi.h | ||
target_page.h | ||
translate-all.h | ||
translator.h |