~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/cmd/5c/txt.c

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
void
293
293
regalloc(Node *n, Node *tn, Node *o)
294
294
{
295
 
        int i, j;
296
 
        static int lasti;
 
295
        int i;
297
296
 
298
297
        switch(tn->type->etype) {
299
298
        case TCHAR:
310
309
                        if(i >= 0 && i < NREG)
311
310
                                goto out;
312
311
                }
313
 
                j = lasti + REGRET+1;
314
 
                for(i=REGRET+1; i<NREG; i++) {
315
 
                        if(j >= NREG)
316
 
                                j = REGRET+1;
317
 
                        if(reg[j] == 0) {
318
 
                                i = j;
 
312
                for(i=REGRET+1; i<=REGEXT-2; i++)
 
313
                        if(reg[i] == 0)
319
314
                                goto out;
320
 
                        }
321
 
                        j++;
322
 
                }
323
315
                diag(tn, "out of fixed registers");
324
316
                goto err;
325
317
 
331
323
                        if(i >= NREG && i < NREG+NFREG)
332
324
                                goto out;
333
325
                }
334
 
                j = 0*2 + NREG;
335
 
                for(i=NREG; i<NREG+NFREG; i++) {
336
 
                        if(j >= NREG+NFREG)
337
 
                                j = NREG;
338
 
                        if(reg[j] == 0) {
339
 
                                i = j;
 
326
                for(i=NREG; i<NREG+NFREG; i++)
 
327
                        if(reg[i] == 0)
340
328
                                goto out;
341
 
                        }
342
 
                        j++;
343
 
                }
344
329
                diag(tn, "out of float registers");
345
330
                goto err;
346
331
        }
350
335
        return;
351
336
out:
352
337
        reg[i]++;
353
 
/*      lasti++;        *** StrongARM does register forwarding */
354
 
        if(lasti >= 5)
355
 
                lasti = 0;
356
338
        nodreg(n, tn, i);
357
339
}
358
340