SDCC 2.7.0 does not run correctly under Mac OS X Intel using gcc 4.0.1, in some cases it produces incorrect code, and in other cases it crashes. I have isolated one specific (non-crash) behavior to the following minimal test case.
The following test code compiles correctly under gcc version 3.4.2 [FreeBSD] 20040728 and incorrectly under gcc version 4.0.1 (Apple Computer, Inc. build 5367). To isolate the problem, I ran SDCC in '--dumptree' mode and found that the bug occurs at the intermediate code level.
sdcc --dumptree -mmcs51 -c test.c -o test.rel
epcs (char ep)
ep &= ~0x80;
EXPECTED BEHAVIOR: (obtained from SDCC 2.7.0 under FreeBSD gcc 3.4.2)
sdcc-test.c:4: CONSTANT (0x82db180) value = 127, 0x7f 127.000000 type (literal-char)
ACTUAL BEHAVIOR: (obtained from SDCC 2.7.0 under Mac OS X gcc 4.0.1)
sdcc-test.c:4: CONSTANT (0x5399e0) value = 0, 0x0, 0.000000 type(literal-char)
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.0 #4818 (Aug 17 2007) (UNIX)
Log in to post a comment.