History

Add comment to explain the code added by 41ce391c

Add a comment in arm-gen.c to explain how commit 41ce391c86df135609af33658414d4d452c5beb3 solves the register corruption when passing a structure in a function call.

Thomas Preud'homme committed 12 years ago

Commit 82b257c1 parent 48fc7461 file · +4 −1Browse files

Unified · Split

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