From e5a04204a913bafb8528229e2363d2a77456223e Mon Sep 17 00:00:00 2001 From: tecodev Date: Sun, 3 Sep 2006 14:39:49 +0000 Subject: [PATCH] * src/pic/ralloc.c, * src/pic/pcode.c (InitReuseRegs): allocate registers with pseudo indices >= 0x1000 to disambiguate them from fixed regs __at(addr), fixes #1550049 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4354 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 7 +++++++ src/pic/pcode.c | 4 +++- src/pic/ralloc.c | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f94884a7..d0a56e0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-03 Raphael Neider + + * src/pic/ralloc.c, + * src/pic/pcode.c (InitReuseRegs): allocate registers with pseudo + indices >= 0x1000 to disambiguate them from fixed regs __at(addr), + fixes #1550049 + 2006-09-01 Borut Razem * sim/ucsim/cmd.src/cmdutil.cc: #include and diff --git a/src/pic/pcode.c b/src/pic/pcode.c index 8af55b1b..d29b62e4 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -5654,7 +5654,9 @@ DEFSETFUNC (resetrIdx) void InitReuseReg(void) { /* Find end of statically allocated variables for start idx */ - unsigned maxIdx = 0x20; /* Start from begining of GPR. Note may not be 0x20 on some PICs */ + /* Start from begining of GPR. Note may not be 0x20 on some PICs */ + /* XXX: Avoid clashes with fixed registers, start late. */ + unsigned maxIdx = 0x1000; regs *r; for (r = setFirstItem(dynDirectRegs); r; r = setNextItem(dynDirectRegs)) { if (r->type != REG_SFR) { diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index d8b5d8df..a73247fd 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -82,8 +82,8 @@ set *dynInternalRegs=NULL; static hTab *dynDirectRegNames= NULL; // static hTab *regHash = NULL; /* a hash table containing ALL registers */ -static int dynrIdx=0x20; -static int rDirectIdx=0; +static int dynrIdx = 0x1000; +static int rDirectIdx = 0x5000; int pic14_nRegs = 128; // = sizeof (regspic14) / sizeof (regs); -- 2.30.2