History

riscv target did not handle FUNC_OLD correctly.

herman ten brugge committed 1 year ago

Commit 03184fe1 parent 37e1c881 file · +4 −3Browse files

Unified · Split

riscv64-gen.c+4−3
@@ -556,6 +556,7 @@ ST_FUNC void gfunc_call(int nb_args) · 555 unmodified lines
556 int i, align, size, areg[2];556 int i, align, size, areg[2];
557 int *info = tcc_malloc((nb_args + 1) * sizeof (int));557 int *info = tcc_malloc((nb_args + 1) * sizeof (int));
558 int stack_adj = 0, tempspace = 0, stack_add, ofs, splitofs = 0;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 SValue *sv;560 SValue *sv;
560 Sym *sa;561 Sym *sa;
561 562
@@ -583,8 +584,8 @@ ST_FUNC void gfunc_call(int nb_args) · 21 unmodified lines
583 size = align = 8;584 size = align = 8;
584 byref = 64 | (tempofs << 7);585 byref = 64 | (tempofs << 7);
585 }586 }
586 reg_pass(&sv->type, prc, fieldofs, sa != 0);587 reg_pass(&sv->type, prc, fieldofs, old || sa != 0);
587 if (!sa && align == 2*XLEN && size <= 2*XLEN)588 if (!old && !sa && align == 2*XLEN && size <= 2*XLEN)
588 areg[0] = (areg[0] + 1) & ~1;589 areg[0] = (areg[0] + 1) & ~1;
589 nregs = prc[0];590 nregs = prc[0];
590 if (size == 0)591 if (size == 0)
@@ -599,7 +600,7 @@ ST_FUNC void gfunc_call(int nb_args) · 8 unmodified lines
599 if (align < XLEN)600 if (align < XLEN)
600 align = XLEN;601 align = XLEN;
601 stack_adj += (size + align - 1) & -align;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 areg[0] = 8, areg[1] = 16;604 areg[0] = 8, areg[1] = 16;
604 } else {605 } else {
605 info[i] = areg[prc[1] - 1]++;606 info[i] = areg[prc[1] - 1]++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t