mirror of
https://github.com/mirror/tinycc.git
synced 2026-08-22 11:23:27 +08:00
Fix sub-int returns on x86-64 and i386
the ABIs (and other compilers) extend sub-int return values in the caller. TCC extends them in the callee. For compatibility with those other compilers we have extend them in the caller as well. That introduces a useless double extension in pure TCC-compiled code, but fixing that generally requires that the code generator of TCC would understand sub-int types. For the time being bite the bullet.
This commit is contained in:
@@ -369,6 +369,7 @@ static void gcall_or_jmp(int is_jmp)
|
||||
rt = vtop->type.ref->type.t;
|
||||
switch (rt & VT_BTYPE) {
|
||||
case VT_BYTE:
|
||||
case VT_BOOL:
|
||||
if (rt & VT_UNSIGNED) {
|
||||
o(0xc0b60f); /* movzx %al, %eax */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user