* 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
+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
#!/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)
# 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
\begin_layout Date
\size normal
-SDCC 2.7.2
+SDCC 2.7.3
\size footnotesize
\newline
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);
}
#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
}
}
-/** 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)
/* paranoia... */
if (strlen(src) + destLen >= n)
{
- fprintf(stderr, "strncatz prevented buffer overrun!\n");
+ fprintf(stderr, "strncatz prevented buffer overrun!\n");
}
strncat(dest, src, maxToCopy);
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, ...)
{
/* 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 *, ...);
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
{
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
{
{
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
/* 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;
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))
getSize (operandType (IC_RESULT (ic))) > 1)
return;
-
/* has only one definition */
if (bitVectnBitsOn (OP_DEFS (IC_RESULT (ic))) > 1)
return;
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 */
*/
#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)
+{
}
}
#endif
+
+void testBug(void)
+{
+}
}
}
-void test_Peephole251()
+void test_Peephole251(void)
{
var = 12;
f();
/*
- bug1057979.c
+ bug1496419.c
*/
#include <testfwk.h>
//triggers a loop allocating space for symbols node1
//and zzz
const NODE zzz = {&node1, &zzz};
+
+void testBug(void)
+{
+}
const int SPRITE = 0;
int sprite = 1;
+
+void testBug(void)
+{
+}
return (a + b);
}
#endif
+
+void testBug(void)
+{
+}