* device/lib/pic16/libc/string/memccpy.c: changed 3rd argument to char
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 14 Feb 2005 11:00:42 +0000 (11:00 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 14 Feb 2005 11:00:42 +0000 (11:00 +0000)
* src/SDCC.lex (process_pragma): fixed to make disable_warning work for PIC16
* src/pic16/gen.c (aopForSym, calls to pic16_aopOp): prevent unneccessary
  retrievals of result operand's value on assignment

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3680 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/lib/pic16/libc/string/memccpy.c
src/SDCC.lex
src/pic16/gen.c

index 7f6ed7818c6b4c935cad63b0cb8b192e0671a519..e4096f972318006fe1d145091eced2abbdd17167 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-14 Raphael Neider <rneider AT web.de>
+
+       * device/lib/pic16/libc/string/memccpy.c: changed 3rd argument to char
+       * src/SDCC.lex (process_pragma): fixed to make disable_warning work for PIC16
+       * src/pic16/gen.c (aopForSym, calls to pic16_aopOp): prevent unneccessary
+         retrievals of result operand's value on assignment
+
 2005-02-13 Vangelis Rokas <vrokas AT otenet.gr>
 
        * device/include/pic16/string.h: modified prototype for memccpy()
index 9e8d03f05f8f8b5a84e2deb6458b272e190f4f91..73ec684110af14775f062c09044ee8d776313e36 100644 (file)
@@ -26,7 +26,7 @@
 -------------------------------------------------------------------------*/
 #include <string.h>
 
-void *memccpy (void *dst, void *src, int c, size_t acount) 
+void *memccpy (void *dst, void *src, char c, size_t acount) 
 {
   void *ret = dst;
   char *d = dst;
index 1701dbe1b2e48d3315c5357faa0a4798c5df1b6c..43074e9d810e42152ffc5a08e5b3a05bfccaa7ae 100644 (file)
@@ -692,6 +692,10 @@ static int process_pragma(char *s)
   while ((!isspace(*s)) && (*s != '\n'))
     s++ ;
 
+  /* skip separating whitespace */
+  while (isspace(*s) && (*s != '\n'))
+    s++;
+
   /* First give the port a chance */
   if (port->process_pragma && !port->process_pragma(cp))
     return 0;
@@ -706,7 +710,7 @@ static int process_pragma(char *s)
           if (pragma_tbl[i].deprecated != 0)
             werror(W_DEPRECATED_PRAGMA, pragma_tbl[i].name);
 
-          doPragma(pragma_tbl[i].id, cp + len);
+          doPragma(pragma_tbl[i].id, s);
           return 0;
         }
     }
index 31b932c50825f93d7c45cf62e97154658ba6dfc3..d87d6303c7e0537e4f4aa108fc35e70dfe2cccc6 100644 (file)
@@ -702,7 +702,10 @@ static asmop *aopForSym (iCode *ic, operand *op, bool result)
 
 #if 1
        DEBUGpic16_emitcode(";","%d sym->rname = %s, size = %d stack = %d",__LINE__,sym->rname,aop->size, sym->stack);
-       
+
+       // we do not need to load the value if it is to be defined...
+       if (result) return aop;
+
        if(_G.accInUse) {
                pic16_pushpCodeOp( pic16_popCopyReg(&pic16_pc_wreg) );
        }
@@ -7596,7 +7599,7 @@ static void genAndOp (iCode *ic)
     only those used in arthmetic operations remain */
     pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE);
     pic16_aopOp((right=IC_RIGHT(ic)),ic,FALSE);
-    pic16_aopOp((result=IC_RESULT(ic)),ic,FALSE);
+    pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE);
 
     DEBUGpic16_pic16_AopType(__LINE__,left,right,result);
 
@@ -7645,7 +7648,7 @@ static void genOrOp (iCode *ic)
     only those used in arthmetic operations remain */
     pic16_aopOp((left=IC_LEFT(ic)),ic,FALSE);
     pic16_aopOp((right=IC_RIGHT(ic)),ic,FALSE);
-    pic16_aopOp((result=IC_RESULT(ic)),ic,FALSE);
+    pic16_aopOp((result=IC_RESULT(ic)),ic,TRUE);
 
     DEBUGpic16_pic16_AopType(__LINE__,left,right,result);
 
@@ -8687,7 +8690,7 @@ static void genRRC (iCode *ic)
   left = IC_LEFT(ic);
   result=IC_RESULT(ic);
   pic16_aopOp (left,ic,FALSE);
-  pic16_aopOp (result,ic,FALSE);
+  pic16_aopOp (result,ic,TRUE);
 
   DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result);
 
@@ -8732,7 +8735,7 @@ static void genRLC (iCode *ic)
   left = IC_LEFT(ic);
   result=IC_RESULT(ic);
   pic16_aopOp (left,ic,FALSE);
-  pic16_aopOp (result,ic,FALSE);
+  pic16_aopOp (result,ic,TRUE);
 
   DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result);
 
@@ -9767,7 +9770,7 @@ void pic16_genLeftShiftLiteral (operand *left,
     pic16_freeAsmop(right,NULL,ic,TRUE);
 
     pic16_aopOp(left,ic,FALSE);
-    pic16_aopOp(result,ic,FALSE);
+    pic16_aopOp(result,ic,TRUE);
 
     size = getSize(operandType(result));
 
@@ -10375,7 +10378,7 @@ static void genRightShiftLiteral (operand *left,
   pic16_freeAsmop(right,NULL,ic,TRUE);
 
   pic16_aopOp(left,ic,FALSE);
-  pic16_aopOp(result,ic,FALSE);
+  pic16_aopOp(result,ic,TRUE);
 
   DEBUGpic16_emitcode ("; ***","%s  %d shCount:%d result:%d left:%d",__FUNCTION__,__LINE__,shCount,AOP_SIZE(result),AOP_SIZE(left));
 
@@ -10723,7 +10726,7 @@ static void genGenericShift (iCode *ic, int isShiftLeft) {
 
   pic16_aopOp(right,ic,FALSE);
   pic16_aopOp(left,ic,FALSE);
-  pic16_aopOp(result,ic,FALSE);
+  pic16_aopOp(result,ic,TRUE);
 
   sign = !SPEC_USIGN(operandType (left));
   signedCount = !SPEC_USIGN(operandType (right));
@@ -11030,7 +11033,7 @@ static void genDataPointerGet(operand *left,
   int size, offset = 0, leoffset=0 ;
 
        DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-       pic16_aopOp(result, ic, FALSE);
+       pic16_aopOp(result, ic, TRUE);
 
        size = AOP_SIZE(result);
 //     fprintf(stderr, "%s:%d size= %d\n", __FILE__, __LINE__, size);
@@ -11139,7 +11142,7 @@ static void genNearPointerGet (operand *left,
     }
     
     DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    pic16_aopOp (result,ic,FALSE);
+    pic16_aopOp (result,ic,TRUE);
     
     DEBUGpic16_pic16_AopType(__LINE__, left, NULL, result);
 
@@ -11278,7 +11281,7 @@ static void genPagedPointerGet (operand *left,
        rname = pic16_aopGet(AOP(left),0,FALSE,FALSE);
     
     pic16_freeAsmop(left,NULL,ic,TRUE);
-    pic16_aopOp (result,ic,FALSE);
+    pic16_aopOp (result,ic,TRUE);
 
     /* if bitfield then unpack the bits */
     if (IS_BITFIELD(retype)) 
@@ -11356,7 +11359,7 @@ static void genFarPointerGet (operand *left,
     }
     /* so dptr know contains the address */
     pic16_freeAsmop(left,NULL,ic,TRUE);
-    pic16_aopOp(result,ic,FALSE);
+    pic16_aopOp(result,ic,TRUE);
 
     /* if bit then unpack */
     if (IS_BITFIELD(retype)) 
@@ -11508,7 +11511,7 @@ static void genGenPointerGet (operand *left,
 
     DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     pic16_aopOp(left,ic,FALSE);
-    pic16_aopOp(result,ic,FALSE);
+    pic16_aopOp(result,ic,TRUE);
     size = AOP_SIZE(result);
 
     DEBUGpic16_pic16_AopType(__LINE__,left,NULL,result);