> I think this is the wrong place to fix this. If you would override > the sizetypes precision from your target, would that fix it? That > is, in stor-layout.c set_sizetype make the target allow adjusting > the passed type (which is supposed to be sizetype). If at all then > these types should be consistent.
The problem is that the chip has 24 bit pointers, but 16 bit registers. It has math operations for 16 bit numbers and some 32 bit numbers (the rest are emulated). It has a few operations for 24 bit numbers. There are no C types for 24 bit numbers (PSImode is 32 bits wide with 24 bit precision, if I tweak its precision manually it tries to use bitfield instructions all over the place, if I don't it uses "long int" which is wrong). All I want for now is to treat ptr+int as a signed addition, not an unsigned one. My patch is just trying to detect the case where a sign extension is needed at all, and insert it.