From 3e896c0ba619568082bc9e952265022cad9fe911 Mon Sep 17 00:00:00 2001 From: epetrich Date: Tue, 8 Jun 2004 06:05:47 +0000 Subject: [PATCH] * src/avr/ralloc.c (serialRegAssign), * src/xa51/ralloc.c (serialRegAssign), * src/pic/ralloc.c (serialRegAssign), * src/pic16/ralloc.c (serialRegAssign), * src/hc08/ralloc.c (serialRegAssign), * src/z80/ralloc.c (serialRegAssign), * src/ds390/ralloc.c (serialRegAssign), * src/mcs51/ralloc.c (serialRegAssign): fixed bug #964479 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3356 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 11 +++++++++++ src/avr/ralloc.c | 11 +++++++++++ src/ds390/ralloc.c | 11 +++++++++++ src/hc08/ralloc.c | 10 ++++++++++ src/mcs51/ralloc.c | 10 ++++++++++ src/pic/ralloc.c | 11 +++++++++++ src/pic16/ralloc.c | 11 +++++++++++ src/xa51/ralloc.c | 10 ++++++++++ src/z80/ralloc.c | 11 +++++++++++ 9 files changed, 96 insertions(+) diff --git a/ChangeLog b/ChangeLog index 36d2c9d3..1f5c40e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-06-08 Erik Petrich + + * src/avr/ralloc.c (serialRegAssign), + * src/xa51/ralloc.c (serialRegAssign), + * src/pic/ralloc.c (serialRegAssign), + * src/pic16/ralloc.c (serialRegAssign), + * src/hc08/ralloc.c (serialRegAssign), + * src/z80/ralloc.c (serialRegAssign), + * src/ds390/ralloc.c (serialRegAssign), + * src/mcs51/ralloc.c (serialRegAssign): fixed bug #964479 + 2004-06-08 Erik Petrich * src/SDCCicode.c (geniCodeJumpTable): fixed bug #967601 diff --git a/src/avr/ralloc.c b/src/avr/ralloc.c index abecd394..fce0f802 100644 --- a/src/avr/ralloc.c +++ b/src/avr/ralloc.c @@ -1393,6 +1393,17 @@ serialRegAssign (eBBlock ** ebbs, int count) continue; } + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) + { + spillThis (sym); + continue; + } + /* if it has a spillocation & is used less than all other live ranges then spill this */ if (willCS) { diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index afede94d..618c1651 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -1332,6 +1332,17 @@ serialRegAssign (eBBlock ** ebbs, int count) } + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) + { + spillThis (sym); + continue; + } + /* if it has a spillocation & is used less than all other live ranges then spill this */ if (willCS) { diff --git a/src/hc08/ralloc.c b/src/hc08/ralloc.c index 4669e852..25c75138 100644 --- a/src/hc08/ralloc.c +++ b/src/hc08/ralloc.c @@ -1289,6 +1289,16 @@ serialRegAssign (eBBlock ** ebbs, int count) continue; } + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) { + spillThis (sym); + continue; + } + /* if it has a spillocation & is used less than all other live ranges then spill this */ if (willCS) { diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 8d7f6556..ffa28c05 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1237,6 +1237,16 @@ serialRegAssign (eBBlock ** ebbs, int count) spillThis (sym); continue; } + + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) { + spillThis (sym); + continue; + } /* if it has a spillocation & is used less than all other live ranges then spill this */ diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index e71c82f9..cce44ed1 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -2319,6 +2319,17 @@ serialRegAssign (eBBlock ** ebbs, int count) continue; } + + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) + { + spillThis (sym); + continue; + } /* if it has a spillocation & is used less than all other live ranges then spill this */ diff --git a/src/pic16/ralloc.c b/src/pic16/ralloc.c index 93cab98d..7d5e782d 100644 --- a/src/pic16/ralloc.c +++ b/src/pic16/ralloc.c @@ -2190,6 +2190,17 @@ serialRegAssign (eBBlock ** ebbs, int count) } + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) + { + spillThis (sym); + continue; + } + /* if it has a spillocation & is used less than all other live ranges then spill this */ if (willCS) { diff --git a/src/xa51/ralloc.c b/src/xa51/ralloc.c index 1f530ece..27c88a44 100755 --- a/src/xa51/ralloc.c +++ b/src/xa51/ralloc.c @@ -1010,6 +1010,16 @@ serialRegAssign (eBBlock ** ebbs, int count) continue; } + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) { + spillThis (sym); + continue; + } + /* if it has a spillocation & is used less than all other live ranges then spill this */ if (willCS) { diff --git a/src/z80/ralloc.c b/src/z80/ralloc.c index ed6868c8..53f21219 100644 --- a/src/z80/ralloc.c +++ b/src/z80/ralloc.c @@ -1168,6 +1168,17 @@ serialRegAssign (eBBlock ** ebbs, int count) } + /* If the live range preceeds the point of definition + then ideally we must take into account registers that + have been allocated after sym->liveFrom but freed + before ic->seq. This is complicated, so spill this + symbol instead and let fillGaps handle the allocation. */ + if (sym->liveFrom < ic->seq) + { + spillThis (sym); + continue; + } + /* if it has a spillocation & is used less than all other live ranges then spill this */ if (willCS) { -- 2.30.2