diff options
author | Anders Magnusson <ragge@cvs.openbsd.org> | 2007-12-16 19:24:04 +0000 |
---|---|---|
committer | Anders Magnusson <ragge@cvs.openbsd.org> | 2007-12-16 19:24:04 +0000 |
commit | f25a2e590a20bbc951fa2c03d88fe89947229d43 (patch) | |
tree | 2dc2d9347925149c4221b6583520ca25358ac091 /usr.bin/pcc/mip | |
parent | 173bb6918ee47659d00e7fa6ac3ab393b9c4b027 (diff) |
Updates from master repo:
> More sane sanitycheck in e2print().
> Add edges between different needs in table entries to avoid
> that they get painted with the same color.
Diffstat (limited to 'usr.bin/pcc/mip')
-rw-r--r-- | usr.bin/pcc/mip/reader.c | 5 | ||||
-rw-r--r-- | usr.bin/pcc/mip/regs.c | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/usr.bin/pcc/mip/reader.c b/usr.bin/pcc/mip/reader.c index 9629b297a03..ac731cf44bf 100644 --- a/usr.bin/pcc/mip/reader.c +++ b/usr.bin/pcc/mip/reader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reader.c,v 1.11 2007/12/09 18:40:29 ragge Exp $ */ +/* $OpenBSD: reader.c,v 1.12 2007/12/16 19:24:03 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -758,7 +758,8 @@ e2print(NODE *p, int down, int *a, int *b) int gregn(struct regw *); if (p->n_reg == -1) fprintf(prfil, "REG <undef>"); - else if (p->n_reg < 100000) /* XXX */ + else if (0 <= p->n_reg && + p->n_reg < (ENCRD(MAXREGS) + ENCRA(MAXREGS,0))) /* XXX */ fprintf(prfil, "REG %s", rnames[DECRA(p->n_reg, 0)]); else fprintf(prfil, "TEMP %d", gregn(p->n_regw)); diff --git a/usr.bin/pcc/mip/regs.c b/usr.bin/pcc/mip/regs.c index 6fa3043eef8..3e256d3c365 100644 --- a/usr.bin/pcc/mip/regs.c +++ b/usr.bin/pcc/mip/regs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regs.c,v 1.13 2007/12/09 18:34:11 ragge Exp $ */ +/* $OpenBSD: regs.c,v 1.14 2007/12/16 19:24:03 ragge Exp $ */ /* * Copyright (c) 2005 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -899,16 +899,24 @@ insnwalk(NODE *p) #if 1 static int ncl[] = { 0, NASL, NBSL, NCSL, NDSL }; static int ncr[] = { 0, NASR, NBSR, NCSR, NDSR }; - + int j; + /* edges are already added */ - if ((r = &p->n_regw[1+i])->r_class == -1) + if ((r = &p->n_regw[1+i])->r_class == -1) { r = p->n_regw; - else + } else { + AddEdge(r, p->n_regw); addalledges(r); + } if (optype(o) != LTYPE && (q->needs & ncl[CLASS(r)]) == 0) addedge_r(p->n_left, r); if (optype(o) == BITYPE && (q->needs & ncr[CLASS(r)]) == 0) addedge_r(p->n_right, r); + for (j = i + 1; j < n; j++) { + if (p->n_regw[j+1].r_class == -1) + continue; + AddEdge(r, &p->n_regw[j+1]); + } #else if ((r = &p->n_regw[1+i])->r_class == -1) continue; |