From: cuz Date: Sun, 21 Dec 2003 10:23:23 +0000 (+0000) Subject: Fixed wrong assumptions in the optimizer when subroutine calls to absolute X-Git-Tag: V2.12.0~1008 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b0a2e6375ff0e91e01bd078f4b961fce66517d4b;p=cc65 Fixed wrong assumptions in the optimizer when subroutine calls to absolute addresses are made. git-svn-id: svn://svn.cc65.org/cc65/trunk@2800 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/codeinfo.c b/src/cc65/codeinfo.c index 322b471ff..1a583ff02 100644 --- a/src/cc65/codeinfo.c +++ b/src/cc65/codeinfo.c @@ -37,6 +37,7 @@ #include /* common */ +#include "chartype.h" #include "coll.h" /* cc65 */ @@ -309,6 +310,15 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg) return; } + } else if (IsDigit (Name[0]) || Name[0] == '$') { + + /* A call to a numeric address. Assume that all CPU registers get + * used, but no memory contents are changed. + */ + *Use = REG_AXY; + *Chg = REG_AXY; + return; + } else { /* Search for the function in the list of builtin functions */ @@ -629,7 +639,7 @@ unsigned GetKnownReg (unsigned Use, const RegContents* RC) } } - + static cmp_t FindCmpCond (const char* Code, unsigned CodeLen) /* Search for a compare condition by the given code using the given length */