* configure.in,
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 18 Jul 2007 15:17:51 +0000 (15:17 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 18 Jul 2007 15:17:51 +0000 (15:17 +0000)
* doc/sdccman.lyx: bumped version to 2.7.3
* device/include/mcs51/compiler.h: fixed elif->else
* src/mcs51/gen.c (genAnd, genOr): handle accuse for pure bit operands
* src/mcs51/ralloc.c (createStackSpil): fixed SCLS bug with sloc for sbit,
  (operandUsesAcc, packRegsForAccUse): added parameter allowBitspace to
   enable accuse for bit operands
* src/SDCCmain.c (printVersionInfo),
* src/SDCCutil.c (getBuildEnvironment): factored out creation of build
  environment descriptor
* src/SDCCutil.h: added getBuildEnvironment
* src/SDCCglue.c (initialComments): use getBuildEnvironment
* support/regression/tests/bug1464657.c: enabled test test_Peephole251
* support/regression/tests/bug-408972.c: enabled test leftShiftLong
* support/regression/tests/bug1348008.c,
* support/regression/tests/bug1496419.c,
* support/regression/tests/bug1503067.c,
* support/regression/tests/preproc.c: added empty tests

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

16 files changed:
ChangeLog
configure.in
device/include/mcs51/compiler.h
doc/sdccman.lyx
src/SDCCglue.c
src/SDCCmain.c
src/SDCCutil.c
src/SDCCutil.h
src/mcs51/gen.c
src/mcs51/ralloc.c
support/regression/tests/bug-408972.c
support/regression/tests/bug1348008.c
support/regression/tests/bug1464657.c
support/regression/tests/bug1496419.c
support/regression/tests/bug1503067.c
support/regression/tests/preproc.c

index 4c939142b811761d40f40a7a8de6409a6ddded4c..7064b1262186ac7804d9905664c9f97c5de5f23c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2007-07-18 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * configure.in,
+       * doc/sdccman.lyx: bumped version to 2.7.3
+       * device/include/mcs51/compiler.h: fixed elif->else
+       * src/mcs51/gen.c (genAnd, genOr): handle accuse for pure bit operands
+       * src/mcs51/ralloc.c (createStackSpil): fixed SCLS bug with sloc for sbit,
+         (operandUsesAcc, packRegsForAccUse): added parameter allowBitspace to
+          enable accuse for bit operands
+       * src/SDCCmain.c (printVersionInfo),
+       * src/SDCCutil.c (getBuildEnvironment): factored out creation of build
+         environment descriptor
+       * src/SDCCutil.h: added getBuildEnvironment
+       * src/SDCCglue.c (initialComments): use getBuildEnvironment
+       * support/regression/tests/bug1464657.c: enabled test test_Peephole251
+       * support/regression/tests/bug-408972.c: enabled test leftShiftLong
+       * support/regression/tests/bug1348008.c,
+       * support/regression/tests/bug1496419.c,
+       * support/regression/tests/bug1503067.c,
+       * support/regression/tests/preproc.c: added empty tests
+
 2007-07-15 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * support/regression/tests/bug1678803.c: new, added
index 72744df794b38fa81d259c489b5922b928cc13de..22bb30e4d379ca879bf8afdb9637c86d553241c5 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 AC_PREREQ(2.60)
-AC_INIT([sdcc], [2.7.2], [sdcc-devel@lists.sourceforge.net])
+AC_INIT([sdcc], [2.7.3], [sdcc-devel@lists.sourceforge.net])
 AC_CONFIG_SRCDIR([Makefile.in])
 AC_CONFIG_HEADER(sdccconf.h:sdccconf_in.h)
 
index a21bc0fdda06a08a7df68151ebd0c92c269ae78d..425f311488241ef59aa44baef408b36c7810e41b 100644 (file)
 # define SFR32E(name, fulladdr) /* not supported */
 
 /** default
-  * unknown compiler
+  * unrecognized compiler
  */
-#elif
-# warning unknown compiler
+#else
+# warning unrecognized compiler
 # define SBIT(name, addr, bit)  volatile bool           name
 # define SFR(name, addr)        volatile unsigned char  name
 # define SFRX(name, addr)       volatile unsigned char  name
index 4b6e8028e48d5eadec7e9bf167d431d0efb851e6..5dd35501b3087dd1a2559aa997d7db4da5d0c633 100644 (file)
@@ -104,7 +104,7 @@ SDCC Compiler User Guide
 \begin_layout Date
 
 \size normal
-SDCC 2.7.2
+SDCC 2.7.3
 \size footnotesize
 
 \newline
index 96f4635ba851882ca482e410d0678db55c596b87..7c54412473beae273f2908681e9fe6748d054f19 100644 (file)
@@ -1411,8 +1411,9 @@ initialComments (FILE * afile)
   time_t t;
   time (&t);
   fprintf (afile, "%s", iComments1);
-  fprintf (afile, "; Version " SDCC_VERSION_STR " #%s (%s)\n", getBuildNumber(), __DATE__);
-  fprintf (afile, "; This file generated %s", asctime (localtime (&t)));
+  fprintf (afile, "; Version " SDCC_VERSION_STR " #%s (%s) (%s)\n",
+           getBuildNumber(), __DATE__, getBuildEnvironment());
+  fprintf (afile, "; This file was generated %s", asctime (localtime (&t)));
   fprintf (afile, "%s", iComments2);
 }
 
index 2fec363daafdde6840cb4a99f0f2f7bfa853ec83..2ef990359f66c51a64986b1fea558cf6be328607 100644 (file)
@@ -424,21 +424,8 @@ printVersionInfo (FILE *stream)
 #ifdef SDCC_SUB_VERSION_STR
            "/" SDCC_SUB_VERSION_STR
 #endif
-           " #%s (" __DATE__ ")"
-#ifdef __CYGWIN__
-           " (CYGWIN)\n"
-#elif defined __MINGW32__
-           " (MINGW32)\n"
-#elif defined __DJGPP__
-           " (DJGPP)\n"
-#elif defined(_MSC_VER)
-           " (MSVC)\n"
-#elif defined(__BORLANDC__)
-           " (BORLANDC)\n"
-#else
-           " (UNIX)\n"
-#endif
-    , getBuildNumber() );
+           " #%s (" __DATE__ ") (%s)",
+           getBuildNumber(), getBuildEnvironment() );
 }
 
 static void
index adfcff76c6a8e09308f25ec5efaff9b6f9f6608f..c092edb8e2442f2d69ac736e62c4bfe141207866 100644 (file)
@@ -197,7 +197,7 @@ dbuf_splitFile(const char *path, struct dbuf_s *file, struct dbuf_s *ext)
     }
 }
 
-/** Combile directory and the file name to a path string using the DIR_SEPARATOR_CHAR.
+/** Combine directory and the file name to a path string using the DIR_SEPARATOR_CHAR.
  */
 void
 dbuf_makePath(struct dbuf_s *path,const char *dir, const char *file)
@@ -375,7 +375,7 @@ char *strncatz(char *dest, const char *src, size_t n)
     /* paranoia... */
     if (strlen(src) + destLen >= n)
     {
-       fprintf(stderr, "strncatz prevented buffer overrun!\n");
+        fprintf(stderr, "strncatz prevented buffer overrun!\n");
     }
     
     strncat(dest, src, maxToCopy);
@@ -391,6 +391,26 @@ const char *getBuildNumber(void)
   return (SDCC_BUILD_NUMBER);
 }
 
+/*-----------------------------------------------------------------*/
+/* getBuildEnvironment - return environment used to build SDCC     */
+/*-----------------------------------------------------------------*/
+const char *getBuildEnvironment(void)
+{
+#ifdef __CYGWIN__
+  return "CYGWIN";
+#elif defined __MINGW32__
+  return "MINGW32";
+#elif defined __DJGPP__
+  return "DJGPP";
+#elif defined(_MSC_VER)
+  return "MSVC";
+#elif defined(__BORLANDC__)
+  return "BORLANDC";
+#else
+  return "UNIX";
+#endif
+}
+
 #if defined(HAVE_VSNPRINTF) || defined(HAVE_VSPRINTF)
 size_t SDCCsnprintf(char *dst, size_t n, const char *fmt, ...)
 {
index 6e3800b764b759724f2fc1e8e4703a4e16c05e52..b2e732f700b2ca5c5b19e7eb9c20da1db3f1c689 100644 (file)
@@ -102,6 +102,9 @@ char *strncatz (char *dest, const char *src, size_t n);
 /* return SDCC build number */
 const char *getBuildNumber (void);
 
+/* return environment used to build SDCC */
+const char *getBuildEnvironment(void);
+
 /* snprintf, by hook or by crook. */
 size_t SDCCsnprintf (char *, size_t, const char *, ...);
 
index cb42cdeb452318abcb8b476399b5a11f9d480c34..e9f0df3c3907375972af4590d50cd15bb25af35b 100644 (file)
@@ -6634,8 +6634,15 @@ genAnd (iCode * ic, iCode * ifx)
           if (AOP_TYPE (right) == AOP_CRY)
             {
               // c = bit & bit;
-              emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir);
-              emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir);
+              if (IS_OP_ACCUSE (left))
+                {
+                  emitcode ("anl", "c,%s", AOP (right)->aopu.aop_dir);
+                }
+                         else
+                {
+                  emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir);
+                  emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir);
+                }
             }
           else
             {
@@ -7056,8 +7063,15 @@ genOr (iCode * ic, iCode * ifx)
           if (AOP_TYPE (right) == AOP_CRY)
             {
               // c = bit | bit;
-              emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir);
-              emitcode ("orl", "c,%s", AOP (left)->aopu.aop_dir);
+              if (IS_OP_ACCUSE (left))
+                {
+                  emitcode ("orl", "c,%s", AOP (right)->aopu.aop_dir);
+                }
+                         else
+                {
+                  emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir);
+                  emitcode ("orl", "c,%s", AOP (left)->aopu.aop_dir);
+                }
             }
           else
             {
index 833c70e18ff6820b69b2ca76a559a4d44986c073..1334894eb960dece6cb6f045d7033b60abbbda79 100644 (file)
@@ -527,12 +527,16 @@ createStackSpil (symbol * sym)
     {
       SPEC_SCLS (sloc->etype) = S_DATA;
     }
+  else if (SPEC_SCLS (sloc->etype) == S_SBIT)
+    {
+      SPEC_SCLS (sloc->etype) = S_BIT;
+    }
   SPEC_EXTR (sloc->etype) = 0;
   SPEC_STAT (sloc->etype) = 0;
   SPEC_VOLATILE(sloc->etype) = 0;
   SPEC_ABSA(sloc->etype) = 0;
 
-  /* we don't allow it to be allocated`
+  /* we don't allow it to be allocated
      onto the external stack since : so we
      temporarily turn it off ; we also
      turn off memory model to prevent
@@ -2656,7 +2660,7 @@ bool isCommutativeOp(unsigned int op)
 /* operandUsesAcc - determines whether the code generated for this */
 /*                  operand will have to use the accumulator       */
 /*-----------------------------------------------------------------*/
-bool operandUsesAcc(operand *op)
+bool operandUsesAcc(operand *op, bool allowBitspace)
 {
   if (!op)
     return FALSE;
@@ -2686,7 +2690,7 @@ bool operandUsesAcc(operand *op)
     if (sym->iaccess && symspace->paged)
       return TRUE;  /* must fetch paged indirect sym via accumulator */
 
-    if (IN_BITSPACE(symspace))
+    if (!allowBitspace && IN_BITSPACE(symspace))
       return TRUE;  /* fetching bit vars uses the accumulator */
 
     if (IN_FARSPACE(symspace) || IN_CODESPACE(symspace))
@@ -2740,7 +2744,6 @@ packRegsForAccUse (iCode * ic)
       getSize (operandType (IC_RESULT (ic))) > 1)
     return;
 
-
   /* has only one definition */
   if (bitVectnBitsOn (OP_DEFS (IC_RESULT (ic))) > 1)
     return;
@@ -2810,10 +2813,10 @@ packRegsForAccUse (iCode * ic)
     goto accuse;
 
   /* if the other operand uses the accumulator then we cannot */
-  if ( (IC_LEFT(uic)->key == IC_RESULT(ic)->key &&
-        operandUsesAcc(IC_RIGHT(uic))) ||
+  if ( (IC_LEFT (uic)->key == IC_RESULT (ic)->key &&
+        operandUsesAcc (IC_RIGHT (uic), IS_BIT (operandType (IC_LEFT (uic))))) ||
        (IC_RIGHT(uic)->key == IC_RESULT(ic)->key &&
-        operandUsesAcc(IC_LEFT(uic))) )
+        operandUsesAcc (IC_LEFT (uic), IS_BIT (operandType (IC_RIGHT (uic))))) )
     return;
 
   /* make sure this is on the left side if not commutative */
index 23988240e9a94e41bc6382fbabff03a2cd9edc5f..29cc2543890504150ac0fdbf1b7f33af0ddbdca1 100644 (file)
@@ -2,23 +2,22 @@
  */
 #include <testfwk.h>
 
-long leftShiftLong (long l) { 
-  /* PENDING: Disabled.
-     return (l << 3); 
-  */
-  return l;
-} 
-
+long leftShiftLong (long l) {
+    return (l << 3);
+}
 
-int leftShiftIntMasked (int v) { 
-  return ((v & 0xff00U) << 3); 
-} 
+int leftShiftIntMasked (int v) {
+    return ((v & 0xff00U) << 3);
+}
 
-int leftShiftIntMasked2 (int v) { 
-    return ((v & 0xff) << 8); 
-} 
+int leftShiftIntMasked2 (int v) {
+    return ((v & 0xff) << 8);
+}
 
+int leftShiftIntMasked3 (int v) {
+    return ((v & 0xff) << 3);
+}
 
-int leftShiftIntMasked3 (int v) { 
-    return ((v & 0xff) << 3); 
+void testBug(void)
+{
 }
index 250e34171adaf12fe6817af52d1e76b4fbe7b9b7..b0b4302e82e2622a36ec613a0a180e3a5cb63c13 100644 (file)
@@ -14,3 +14,7 @@ void IRQ_ISR(void) interrupt
 }
 
 #endif
+
+void testBug(void)
+{
+}
index b32bef44b802122ff79d14a2ace88c35954f102f..88668f74e61baf6f686370a0c83eed5a63c93f9a 100644 (file)
@@ -62,7 +62,7 @@ void f()
   }
 }
 
-void test_Peephole251()
+void test_Peephole251(void)
 {
   var = 12;
   f();
index 39c738348ae3d2ef7e20ad7bc4cf07b856ab7a54..b23b09286444f5eda79769aed9e921dd3d1c500e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   bug1057979.c
+   bug1496419.c
 */
 
 #include <testfwk.h>
@@ -19,3 +19,7 @@ const NODE node1 = {NULL, NULL};
 //triggers a loop allocating space for symbols node1
 //and zzz
 const NODE zzz = {&node1, &zzz};
+
+void testBug(void)
+{
+}
index cf578437f7dc96db33a413ede8ff01fecca06c86..f11a6505dede12eda46c19c9d34e804d54f7d2db 100644 (file)
@@ -4,3 +4,7 @@
 
 const int SPRITE = 0;
 int sprite = 1;
+
+void testBug(void)
+{
+}
index f83d9921d6eb8b3e2b4e22915951e00ee1010012..dc5940c390b5d1448a922aa753e09d5a61a7e1e4 100644 (file)
@@ -48,3 +48,7 @@ unsigned char b=0xfe-BAD(3);
 return (a + b);
 }
 #endif
+
+void testBug(void)
+{
+}