gigatron-rom icon indicating copy to clipboard operation
gigatron-rom copied to clipboard

lcc: compiler hangs on simple statement

Open kervinck opened this issue 5 years ago • 2 comments

$ cat hang2.c
int f(int c)
{ 
  if (c == -1)
    return 0;
}
$ make hang2.gt1
Utils/lcc/build/lcc -ILibs -c hang2.c -o hang2.o
hang2.c:5: warning: missing return value
Assertion failed: (offset < 0x10000lu), function local, file ./build/gt1.c, line 4435.
Utils/lcc/build/lcc: fatal error in Utils/lcc/build/rcc
make: *** [hang2.o] Error 1
$

Similar to #76 but not the same.

kervinck avatar May 27 '19 16:05 kervinck

This is in fact the same type of register spilling issue as #76. We can solve it with #76, or workaround it by replacing SUBW with XORW for the relational operator (this could be part of #64).

kervinck avatar Jun 04 '19 20:06 kervinck

This issue should be closed since glcc fixes it.

lb3361 avatar Aug 25 '22 12:08 lb3361