When compiling for target stm8, the following code cause error "Internal error: validateOpType failed in OP_VALUE(op) @ SDCCicode.c:1153: expected value, got symbol"
struct object_t
{
uint8_t field1;
uint8_t field2;
};
(intptr_t)(&(((struct object_t*)0)->field2));
SDCC version: SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.7.1 #10392 (Linux)
PS: the same code works on 3.6.0 & 3.7.0.
PPS: the builtin macro offsetof works fine.
I can reproduce the issue, and confirm that it is a regression from 3.7.0.
It is not stm8-specific though, it fails for all backends I tried (stm8, mcs51, z80).
Philipp
Works for me in SDCC from current svn trunk.