diff options
| author | 2023-06-14 15:05:43 +0200 | |
|---|---|---|
| committer | 2023-06-14 15:05:43 +0200 | |
| commit | 782d4e9df0363ca9f64d8b92a3d6952d552f13a5 (patch) | |
| tree | 8c71e107a8c0b54f53c2c94d053ad4cc1b7a441d /abi0.c | |
| parent | 8d8cf6584bf4081b54cd91fcaa42578cbd794440 (diff) | |
add spilling for function calls, misc fixes
Diffstat (limited to 'abi0.c')
| -rw-r--r-- | abi0.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -227,8 +227,13 @@ abi0_call(struct function *fn, struct instr *ins, struct block *blk, int *curi) if (call->ret.isagg) { replref(fn, blk, (*curi), mkref(RTMP, ins - instrtab), retmem); if (!nret) { /* hidden pointer argument */ - if (call->abiret[0].reg >= 0) + if (call->abiret[0].reg >= 0) { + /* the result location pointer is also returned by the callee, like in x86 */ ++nret; + insertinstr(blk, ++*curi, mkinstr(Ocopy, KPTR, mkref(RREG, call->abiret[0].reg))); + /* even if this is not used it the register copy + * must be emitted for the register allocator to know */ + } } else { /* aggregate returned in regs */ union ref r[2]; struct instr ins; |