diff options
Diffstat (limited to 'src/cmd/5c')
-rw-r--r-- | src/cmd/5c/gc.h | 2 | ||||
-rw-r--r-- | src/cmd/5c/txt.c | 28 |
2 files changed, 6 insertions, 24 deletions
diff --git a/src/cmd/5c/gc.h b/src/cmd/5c/gc.h index 549e0c88a..ff6d51916 100644 --- a/src/cmd/5c/gc.h +++ b/src/cmd/5c/gc.h @@ -28,7 +28,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - +#include <u.h> #include "../cc/cc.h" #include "../5l/5.out.h" diff --git a/src/cmd/5c/txt.c b/src/cmd/5c/txt.c index 4be1f6f62..a32387bc1 100644 --- a/src/cmd/5c/txt.c +++ b/src/cmd/5c/txt.c @@ -292,8 +292,7 @@ tmpreg(void) void regalloc(Node *n, Node *tn, Node *o) { - int i, j; - static int lasti; + int i; switch(tn->type->etype) { case TCHAR: @@ -310,16 +309,9 @@ regalloc(Node *n, Node *tn, Node *o) if(i >= 0 && i < NREG) goto out; } - j = lasti + REGRET+1; - for(i=REGRET+1; i<NREG; i++) { - if(j >= NREG) - j = REGRET+1; - if(reg[j] == 0) { - i = j; + for(i=REGRET+1; i<=REGEXT-2; i++) + if(reg[i] == 0) goto out; - } - j++; - } diag(tn, "out of fixed registers"); goto err; @@ -331,16 +323,9 @@ regalloc(Node *n, Node *tn, Node *o) if(i >= NREG && i < NREG+NFREG) goto out; } - j = 0*2 + NREG; - for(i=NREG; i<NREG+NFREG; i++) { - if(j >= NREG+NFREG) - j = NREG; - if(reg[j] == 0) { - i = j; + for(i=NREG; i<NREG+NFREG; i++) + if(reg[i] == 0) goto out; - } - j++; - } diag(tn, "out of float registers"); goto err; } @@ -350,9 +335,6 @@ err: return; out: reg[i]++; -/* lasti++; *** StrongARM does register forwarding */ - if(lasti >= 5) - lasti = 0; nodreg(n, tn, i); } |