Re: [Sdcc-user] mpic14: overflow in pointer into array calculation.

2010-03-18 Thread Raphael Neider
Hi Maarten, > Can you please verify this also with a larger array? IIRC sdcc checks the > array size (in bytes) and then decides if it can get away with 8 bit > calculations. You are right -- sdcc does check the array length: demo{1,5,7} work for arr[255], demo{2,3,4,6} fail (my first posting wa

Re: [Sdcc-user] mpic14: overflow in pointer into array calculation.

2010-03-18 Thread Maarten Brock
Hi Raphael, Can you please verify this also with a larger array? IIRC sdcc checks the array size (in bytes) and then decides if it can get away with 8 bit calculations. Greets, Maarten > Hi, > > SDCC (not restricted to the pic ports) seems to be buggy with array > indices; > the problem is visib

Re: [Sdcc-user] mpic14: overflow in pointer into array calculation.

2010-03-17 Thread Raphael Neider
Hi, SDCC (not restricted to the pic ports) seems to be buggy with array indices; the problem is visible in the iCode as well. struct s { int a; int b; char c; } arr[5]; char demo1(unsigned idx) { return arr[idx].c; } char demo2(unsigned idx) { return arr[idx - 32].c; } char demo3(unsigned ch