* src/SDCCicode.c (geniCodeCritical): fixed bug for hc08
* src/z80/gen.c (genCritical, genEndCritical): fixed bug
2077267
* support/regression/tests/bug2077267.c: new, added
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5230
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2008-06-04 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * as/z80/aslist.c (lstsym): changed old K&R to ANSI
+ * src/SDCCicode.c (geniCodeCritical): fixed bug for hc08
+ * src/z80/gen.c (genCritical, genEndCritical): fixed bug 2077267
+ * support/regression/tests/bug2077267.c: new, added
+
2008-09-05 Raphael Neider <rneider AT web.de>
* configure.in, Makefile.common.in: add support for ccache,
* int i loop counter
* int j temporary
* int k temporary
- * char * ptr pointer to an id string
* int nmsym number of symbols
* int narea number of areas
* sym * sp pointer to symbol structure
*/
VOID
-lstsym(fp)
-FILE *fp;
+lstsym(FILE *fp)
{
register int c, i, j, k;
int nmsym, narea;
operand *op = NULL;
sym_link *type;
- if (!options.stackAuto)
+ if (!options.stackAuto && !TARGET_IS_HC08)
{
type = newLink(SPECIFIER);
SPEC_VOLATILE(type) = 1;
//disable interrupt
emit2 ("!di");
//save P/O flag
- emit2 ("push af");
+ _push (PAIR_AF);
}
}
else
{
//restore P/O flag
- emit2 ("pop af");
+ _pop (PAIR_AF);
//parity odd <==> P/O=0 <==> interrupt enable flag IFF2 was 0 <==>
//don't enable interrupts as they were off before
emit2 ("jp PO,!tlabel", tlbl->key + 100);
--- /dev/null
+/*
+ bug 2077267
+*/
+
+#include <testfwk.h>
+
+#ifndef SDCC
+#define __critical
+#endif
+
+void bug(char* x)
+{
+ *x = *x + 1;
+}
+
+void
+testBug(void)
+{
+ char x = 1;
+
+ bug(&x);
+
+ __critical {
+ bug(&x);
+ }
+
+ ASSERT (x == 3);
+}