* src/ds390/ralloc.c (packRegisters),
* src/mcs51/ralloc.c (packRegisters),
* src/z80/ralloc.c (packRegisters): applied fix for bug
1618050, thanks
Robert Larice
* support/regression/tests/bug1618050.c: new, added
* support/regression/fwk/include/testfwk.h,
* support/regression/tests/bug1838000.c: moved _AUTOMEM and _STATMEM to
testfwk.h
* src/SDCCsymt.h: fixed typo in DECLSPEC2TXT
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5069
4a8a32a2-be11-0410-ad9d-
d568d2c75423
* src/SDCCutil.h: added getBuildDate()
* src/SDCCmain.c (printVersionInfo),
* src/SDCCglue.c (initialComments): use getBuildDate() instead of __DATE__
+ * src/*/ralloc.c: removed IS_OP_RUONLY macro
+ * src/ds390/ralloc.c (packRegisters),
+ * src/mcs51/ralloc.c (packRegisters),
+ * src/z80/ralloc.c (packRegisters): applied fix for bug 1618050, thanks
+ Robert Larice
+ * support/regression/tests/bug1618050.c: new, added
+ * src/SDCCsymt.h: fixed typo in DECLSPEC2TXT
+ * support/regression/fwk/include/testfwk.h,
+ * support/regression/tests/bug1838000.c: moved _AUTOMEM and _STATMEM to
+ testfwk.h
2008-03-04 Raphael Neider <rneider AT web.de>
DECLARATOR=1,
SPECIFIER
} SYM_LINK_CLASS;
-#define DECLSPEC2TXT(select) (select==DECLARATOR?"DECLARATOR":select==SPECIFIER?"SPECIFIER":"UNKNOW")
+#define DECLSPEC2TXT(select) (select==DECLARATOR?"DECLARATOR":select==SPECIFIER?"SPECIFIER":"UNKNOWN")
typedef struct sym_link
{
x->select.s.noun == V_SBIT ))
#define IS_BITFIELD(x) (IS_SPEC(x) && (x->select.s.noun == V_BITFIELD))
#define IS_BITVAR(x) (IS_SPEC(x) && (x->select.s.noun == V_BITFIELD || \
- x->select.s.noun == V_BIT || \
+ x->select.s.noun == V_BIT || \
x->select.s.noun == V_SBIT ))
#define IS_BIT(x) (IS_SPEC(x) && (x->select.s.noun == V_BIT || \
x->select.s.noun == V_SBIT ))
}
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/*-----------------------------------------------------------------*/
/* packRegsForOneuse : - will reduce some registers for single Use */
return change;
}
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/*-----------------------------------------------------------------*/
/* packRegsDPTRnuse - color live ranges that can go into extra DPTRS */
IS_SYMOP (IC_RIGHT (ic)) &&
OP_SYMBOL (IC_RIGHT (ic))->remat &&
!IS_CAST_ICODE(OP_SYMBOL (IC_RIGHT (ic))->rematiCode) &&
+ !isOperandGlobal(IC_RESULT(ic)) && /* due to bug 1618050 */
bitVectnBitsOn (OP_SYMBOL (IC_RESULT (ic))->defs) <= 1)
{
OP_SYMBOL (IC_RESULT (ic))->remat =
return changes;
}
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
#if 0
/*-----------------------------------------------------------------*/
IS_SYMOP (IC_RIGHT (ic)) &&
OP_SYMBOL (IC_RIGHT (ic))->remat &&
!IS_CAST_ICODE(OP_SYMBOL (IC_RIGHT (ic))->rematiCode) &&
+ !isOperandGlobal(IC_RESULT(ic)) && /* due to bug 1618050 */
bitVectnBitsOn (OP_SYMBOL (IC_RESULT (ic))->defs) <= 1)
{
OP_SYMBOL (IC_RESULT (ic))->remat =
return change;
}
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/*-----------------------------------------------------------------*/
/* packRegsForOneuse : - will reduce some registers for single Use */
#endif
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
#ifndef NO_packRegsForOneuse
/*-----------------------------------------------------------------*/
/* packRegsForOneuse : - will reduce some registers for single Use */
return change;
}
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/*-----------------------------------------------------------------*/
/* packRegsForOneuse : - will reduce some registers for single Use */
}
#endif
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/** Will reduce some registers for single use.
*/
static iCode *
!POINTER_SET (ic) &&
IS_SYMOP (IC_RIGHT (ic)) &&
OP_SYMBOL (IC_RIGHT (ic))->remat &&
+ !IS_CAST_ICODE(OP_SYMBOL (IC_RIGHT (ic))->rematiCode) &&
+ !isOperandGlobal(IC_RESULT(ic)) && /* due to bug 1618050 */
bitVectnBitsOn (OP_SYMBOL (IC_RESULT (ic))->defs) <= 1)
{
-
OP_SYMBOL (IC_RESULT (ic))->remat =
OP_SYMBOL (IC_RIGHT (ic))->remat;
OP_SYMBOL (IC_RESULT (ic))->rematiCode =
#define LOG(_a) /* hollow log */
#endif
+#ifdef SDCC
+ #include <sdcc-lib.h>
+#else
+ #define _AUTOMEM
+ #define _STATMEM
+#endif
+
#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
# define data
# define idata
--- /dev/null
+/** bug 1618050
+ * global variable px in function buggy, is marked rematr..
+ * and is erronously assumed to retain its value "x" across
+ * the function call to fiddle_px
+ */
+
+#include <testfwk.h>
+
+_STATMEM char * data px;
+_STATMEM char x[2] = {0,42};
+
+void fiddle_px(_STATMEM char * unused) {
+ (volatile char) unused[0]; // shut up
+ px++;
+}
+
+char buggy(void) {
+ px = x;
+ fiddle_px(x);
+ return *px;
+}
+
+void
+testBug(void) {
+ ASSERT(buggy() == 42);
+}
\r
#include <testfwk.h>\r
\r
-#ifdef SDCC\r
- #include <sdcc-lib.h>\r
-#else\r
- #define _AUTOMEM\r
- #define _STATMEM\r
-#endif\r
-\r
typedef struct { char b:1; } t;\r
t glbl = { 0 };\r
t _STATMEM * gp = &glbl;\r