From: tecodev Date: Fri, 1 Dec 2006 08:49:18 +0000 (+0000) Subject: * src/pic/pcode.c (register_reassign): do not crash on recursive code X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=9ef3585c9ac5a871f67ca27b5e7d70bb71ce885b;p=fw%2Fsdcc * src/pic/pcode.c (register_reassign): do not crash on recursive code but emit warning (recursion is not supported for pic14) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4497 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 6403125f..00688395 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-01 Raphael Neider + + * src/pic/pcode.c (register_reassign): do not crash on recursive code + but emit warning (recursion is not supported for pic14) + 2006-11-30 Frieder Ferlemann * src/mcs51/peeph.def: added 101.a,b (moves to int/long xdata) diff --git a/src/pic/pcode.c b/src/pic/pcode.c index 100a5f76..fa1d6eef 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -5272,6 +5272,17 @@ static unsigned register_reassign(pBlock *pb, unsigned idx) pc = setFirstItem(pb->function_entries); if(!pc) return idx; + + if (pb->visited) { + static int output = 0; + if (output < 3) { + pc = findNextpCode(pb->pcHead, PC_FUNCTION); + fprintf(stderr, "WARNING: Recursive code (%s) probably won't work, check the .asm file.\n", + pc ? PCF(pc)->fname : "unknown function"); + output++; + } + return idx; + } pb->visited = 1;