Hello. I've found another bug in SDCC that occurs when you try to cast an address to a pointer, then dereference the pointer and assign a value to it. Here is the code:
unsigned char __data *p;
void f()
{
while(1)
{
*((unsigned char __data *)0) = *p;
}
}
The command I used to run SDCC was `sdcc -c test.c`.
My SDCC version is:
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.1 #6092 (Dec 30 2010) (MINGW32)
The error message I get is:
Internal error: validateOpType failed in OP_DEFS(sym) @ /home/sdcc-builder/build
/sdcc-build/orig/sdcc/src/SDCCloop.c:339: expected symbol, got value
This bug also occurs for variables that are in other memory spaces like __xdata. One workaround for this bug is to declare the variable ahead of time, as a static variable with an __at() to put it at the right address.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Test code to reproduce internal error in SDCC.
Fixed in SDCC 3.0.1 #6213.