wyse03br - 2006-11-14

I got this error message when I compile the following code:

#define REG_ADDR  0x4

volatile char at (REG_ADDR) REG;

int main()  {
  REG = 1;
  *(&REG) = 2;
  *((volatile char *)&REG) = 3;         // This causes the error
  *((volatile char *)REG_ADDR) = 4;     // This line runs fine!
  return 0;

% sdcc -mhc08 at_error.c
Internal error: validateOpType failed in OP_SYMBOL(IC_RESULT (ic)) @ SDCCcse.c:2168: expected symbol, got value

I got a workaround by setting REG as a global in the linker, but it is not a satisfatory solution.

Does anybody know what this error means and how to fix it so that I can use the "at" vars?