mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-17 23:54:16 +08:00
When load() in x86_64-gen.c generates a zero constant for a 64-bit
register, it uses:
o(0xc031 + REG_VALUE(r) * 0x900);
REG_VALUE(r) masks to (r & 7), losing bit 3, and no orex() call
emits the REX prefix needed for registers r8-r15. For TREG_R11
(used by gcall_or_jmp for indirect calls), this emits
"xor %ebx,%ebx" (31 db) instead of "xor %r11d,%r11d" (45 31 db),
clobbering the wrong register.
The test compiles an indirect call through a null function pointer
((void(*)(void))0)() via libtcc, then inspects the generated machine
code for the incorrect encoding.
|
||
|---|---|---|
| .. | ||
| pp | ||
| tests2 | ||
| 42test.h | ||
| abitest.c | ||
| arm-asm-testsuite.sh | ||
| asm-c-connect-1.c | ||
| asm-c-connect-2.c | ||
| asmtest.S | ||
| boundtest.c | ||
| bug.c | ||
| gcctestsuite.sh | ||
| libtcc_debug.c | ||
| libtcc_test_mt.c | ||
| libtcc_test_xor_rex.c | ||
| libtcc_test.c | ||
| Makefile | ||
| nostdlib_test.c | ||
| tcctest.c | ||
| tcctest.h | ||
| testfp.c | ||
| vla_test.c | ||