From 7f9dd27dc8801fce3b9eed88c9460b4e83c632e2 Mon Sep 17 00:00:00 2001 From: bal Date: Wed, 30 Jan 1985 10:47:47 +0000 Subject: [PATCH] bug fixed: assemble_allocs() did generate whole_procedure allocations. These allocations were initialized with a very low profit. Consequently account_regsave rejected these allocations. Solution: repl_allocs() updates the al_profits field of the whole_procedure allocation. --- util/ego/ra/ra_pack.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util/ego/ra/ra_pack.c b/util/ego/ra/ra_pack.c index 1d25777c5..2fe69de2a 100644 --- a/util/ego/ra/ra_pack.c +++ b/util/ego/ra/ra_pack.c @@ -322,11 +322,18 @@ STATIC alloc_p find_prev(alloc,list) } +/* If an item is always put in the same register during different loops, + * we try to put it in that register during the whole procedure. + * The profits of the whole-procedure allocation are updated to prevent + * account_regsave from rejecting it. + */ STATIC repl_allocs(new,old,packed) alloc_p new,old,packed; { alloc_p x,next,prev,*p; + short prof = 0; + new->al_regnr = old->al_regnr; new->al_dummy = old->al_dummy; prev = find_prev(old,packed); @@ -338,12 +345,14 @@ STATIC repl_allocs(new,old,packed) for (x = old; x != (alloc_p) 0; x = next) { next = x->al_mates; if (x->al_item == new->al_item) { + prof += x->al_profits; *p = next; oldalloc(x); } else { p = &x->al_mates; } } + new->al_profits = prof; }