Unified · Split
| @@ -556,6 +556,7 @@ ST_FUNC void gfunc_call(int nb_args) · 555 unmodified lines | ||
| 556 | 556 | int i, align, size, areg[2]; |
| 557 | 557 | int *info = tcc_malloc((nb_args + 1) * sizeof (int)); |
| 558 | 558 | int stack_adj = 0, tempspace = 0, stack_add, ofs, splitofs = 0; |
| 559 | + int old = (vtop[-nb_args].type.ref->f.func_type == FUNC_OLD); | |
| 559 | 560 | SValue *sv; |
| 560 | 561 | Sym *sa; |
| 561 | 562 | |
| @@ -583,8 +584,8 @@ ST_FUNC void gfunc_call(int nb_args) · 21 unmodified lines | ||
| 583 | 584 | size = align = 8; |
| 584 | 585 | byref = 64 | (tempofs << 7); |
| 585 | 586 | } |
| 586 | − reg_pass(&sv->type, prc, fieldofs, sa != 0); | |
| 587 | − if (!sa && align == 2*XLEN && size <= 2*XLEN) | |
| 587 | + reg_pass(&sv->type, prc, fieldofs, old || sa != 0); | |
| 588 | + if (!old && !sa && align == 2*XLEN && size <= 2*XLEN) | |
| 588 | 589 | areg[0] = (areg[0] + 1) & ~1; |
| 589 | 590 | nregs = prc[0]; |
| 590 | 591 | if (size == 0) |
| @@ -599,7 +600,7 @@ ST_FUNC void gfunc_call(int nb_args) · 8 unmodified lines | ||
| 599 | 600 | if (align < XLEN) |
| 600 | 601 | align = XLEN; |
| 601 | 602 | stack_adj += (size + align - 1) & -align; |
| 602 | − if (!sa) /* one vararg on stack forces the rest on stack */ | |
| 603 | + if (!old && !sa) /* one vararg on stack forces the rest on stack */ | |
| 603 | 604 | areg[0] = 8, areg[1] = 16; |
| 604 | 605 | } else { |
| 605 | 606 | info[i] = areg[prc[1] - 1]++; |