+2008-02-25 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/mcs51/ralloc.c (isSpiltOnStack): fixed bug 1565152
+ * support/regression/tests/bug1565152.c: new, added
+
2008-02-26 Borut Razem <borut.razem AT siol.net>
* src/SDCCast.c, doc/adccman.lyx: fixed RFE #1901171: inerger promotion
/*-----------------------------------------------------------------*/
/* isSpiltOnStack - returns true if the spil location is on stack */
+/* or otherwise needs a pointer register */
/*-----------------------------------------------------------------*/
static bool
isSpiltOnStack (symbol * sym)
if (!sym->usl.spillLoc)
return FALSE;
+ if (sym->usl.spillLoc->onStack || sym->usl.spillLoc->iaccess)
+ return TRUE;
+
etype = getSpec (sym->usl.spillLoc->type);
if (IN_STACK (etype))
return TRUE;
selectS = liveRangesWith (lrcs, bitType, ebp, ic);
for (sym = setFirstItem (selectS); sym; sym = setNextItem (selectS))
- {
+ {
bitVectUnSetBit (lrcs, sym->key);
}
}
--- /dev/null
+/*
+ bug 1565152.c
+*/
+
+#include <testfwk.h>
+
+// no need to call this, it generates compiler error for xstack-auto
+// error 9: FATAL Compiler Internal Error
+
+#if defined(SDCC_mcs51)
+#include <8051.h>
+
+unsigned int foo(void)
+{
+ unsigned int i,j;
+ unsigned long l=0;
+
+ for (i=0;i<10;i++)
+ {
+ j=SP; // any SFR would do to generate crash
+ l+=j;
+ }
+ return 1; // <- it gives error on this line
+}
+#endif
+
+void
+testBug(void)
+{
+ ASSERT(1);
+}