From c02cd1d4c80f55027a95aef0ef37cdd435cf32a3 Mon Sep 17 00:00:00 2001 From: kvigor Date: Fri, 11 Jul 2003 17:36:45 +0000 Subject: [PATCH] fix bug 769624 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2728 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/ralloc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index f4f837b2..7af5833c 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -2292,6 +2292,30 @@ static int packRegsDPTRnuse( operand *op , int dptr) nfs++; } + // Check that no other ops in this range have been assigned to dptr1. + // I don't understand why this is not caught by the first check, above. + // But it isn't always, see bug 769624. + if (IC_RESULT(ic) && IS_SYMOP(IC_RESULT(ic)) && + (OP_SYMBOL(IC_RESULT(ic))->dptr == 1)) + { + //fprintf(stderr, "dptr1 already in use in live range #1\n"); + return 0; + } + + if (IC_LEFT(ic) && IS_SYMOP(IC_LEFT(ic)) && + (OP_SYMBOL(IC_LEFT(ic))->dptr == 1)) + { + //fprintf(stderr, "dptr1 already in use in live range # 2\n"); + return 0; + } + + if (IC_RIGHT(ic) && IS_SYMOP(IC_RIGHT(ic)) && + (OP_SYMBOL(IC_RIGHT(ic))->dptr == 1)) + { + //fprintf(stderr, "dptr1 already in use in live range # 3\n"); + return 0; + } + if (nfs && IC_RESULT(ic) && IS_SYMOP(IC_RESULT(ic)) && OP_SYMBOL(IC_RESULT(ic))->ruonly) return 0; -- 2.47.2