From 28592ee1ea1f5cdffcf85472f9de0285d928cf12 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Wed, 3 Aug 2011 16:54:30 +0200 Subject: Imported Upstream version 59 --- src/cmd/5c/gc.h | 2 +- src/cmd/5c/txt.c | 28 +++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) (limited to 'src/cmd/5c') 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 #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) - 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) - j = NREG; - if(reg[j] == 0) { - i = j; + for(i=NREG; i= 5) - lasti = 0; nodreg(n, tn, i); } -- cgit v1.2.3