On Mon, 19 Mar 2012, Eric Botcazou wrote:

> > I am lost here.  Which targets (with ptr_mode size != Pmode size !=
> > sizetype size) are you referring to ?
> 
> Targets for which sizetype mode isn't necessarily equal to ptr_mode like VMS.
> Up to GCC 4.6, sizetype was Pmode in Ada, but ptr_mode in C.

It does make sense to give the target control over the mode used for
sizetype.  Of course a global change of the default (for example to
use Pmode as Ada did) will require testing each affected target,
so I think it makes sense to keep the default as-is.

Btw, we still have the issue on which _precision_ we should use for
sizetype -- if we expect modulo-semantics of arithmetic using it
(thus basically sign-less arithmetic) then the precision has to match
the expectation the C frontend (and other frontends) assume how pointer
offsets are handled.  Currently the C frontend gets this not correct
which means negative offsets will be not correctly handled.

Similar issues arise from the mode/precision chosen for the bitsize
types.  We choose a way to wide precision for them, so the
modulo-semantics assumption does not usually hold for bitsize
quantities.

Richard.

Reply via email to