* support/regression/tests/bug1888147.c: new, added
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5029
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2008-02-20 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/SDCClrange.c (findPrevUse): fixed bug 1888147
+ * support/regression/tests/bug1888147.c: new, added
+
2008-02-20 Philipp Klaus Krause <pkk AT spth.de>
* src/z80/gen.c: fixed bugs #1596270, #1736867
2008-02-20 Philipp Klaus Krause <pkk AT spth.de>
* src/z80/gen.c: fixed bugs #1596270, #1736867
/* computeLiveRanges() is called twice */
if (emitWarnings)
{
/* computeLiveRanges() is called twice */
if (emitWarnings)
{
- werrorfl (ic->filename, ic->lineno, W_LOCAL_NOINIT,
- IS_ITEMP (op) ? OP_SYMBOL (op)->prereqv->name :
- OP_SYMBOL (op)->name);
- OP_SYMBOL (op)->prereqv->reqv = NULL;
- OP_SYMBOL (op)->prereqv->allocreq = 1;
+ if (OP_SYMBOL (op)->prereqv)
+ {
+ werrorfl (ic->filename, ic->lineno, W_LOCAL_NOINIT,
+ OP_SYMBOL (op)->prereqv->name);
+ OP_SYMBOL (op)->prereqv->reqv = NULL;
+ OP_SYMBOL (op)->prereqv->allocreq = 1;
+ }
+ }
+ else
+ {
+ werrorfl (ic->filename, ic->lineno, W_LOCAL_NOINIT,
+ OP_SYMBOL (op)->name);
}
}
/* is this block part of a loop? */
}
}
/* is this block part of a loop? */
- if (IS_ITEMP (op) &&
- ebp->depth != 0)
+ if (IS_ITEMP (op) && ebp->depth != 0)
{
/* extend the life range to the outermost loop */
unvisitBlocks(ebbs, count);
{
/* extend the life range to the outermost loop */
unvisitBlocks(ebbs, count);
--- /dev/null
+/*
+ bug 1888147
+*/
+
+#include <testfwk.h>
+
+// no need to call this, it generates compiler error:
+// Caught signal 11: SIGSEGV
+int foo(int n)
+{
+ int i = 0;
+
+ if (i!=0)
+ return n;
+ return 0;
+}
+
+void
+testBug(void)
+{
+ ASSERT(1);
+}