Add comment to explain the code added by 41ce391c

Add a comment in arm-gen.c to explain how commit
41ce391c86 solves the register corruption
when passing a structure in a function call.
master
Thomas Preud'homme 2013-11-25 11:00:51 +08:00
parent 48fc746652
commit 82b257c29c
1 changed files with 4 additions and 1 deletions

View File

@ -1127,7 +1127,10 @@ static int copy_params(int nb_args, struct plan *plan, int todo)
for(pplan = plan->clsplans[CORE_STRUCT_CLASS]; pplan; pplan = pplan->prev) {
int r;
pplan->sval->r = pplan->start;
/* TODO: why adding fake param */
/* An SValue can only pin 2 registers at best (r and r2) but a structure
can occupy more than 2 registers. Thus, we need to push on the value
stack some fake parameter to have on SValue for each registers used
by a structure (r2 is not used). */
for (r = pplan->start + 1; r <= pplan->end; r++) {
if (todo & (1 << r)) {
nb_extra_sval++;