[PATCH] Fix optimization regression in constant folder

Richard Guenther richard.guenther@gmail.com
Thu Oct 11 16:06:00 GMT 2007


On 10/11/07, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Thu, 11 Oct 2007, Richard Kenner wrote:
>
> > > It was my understanding during this whole thread, that this sizetype with
> > > the funny guarantees only can come out of the Ada frontend (and therefore
> > > needs to be dealt with in the middle end), and should never be produced by
> > > the other languages, in particular not C or C++.
> >
> > EVERY front end produces sizetypes because that's what we put in TYPE_SIZE,
> > etc of types!
>
> Yes, and that's arguably a bug.  I don't see any reasons why the values
> in TYPE_SIZE should be of a type with these properties instead of being a
> simple internal unsigned integer type.

The only reason to have sizetype is that there may be no language defined
integral type of the required precision (which is the precision of
pointers AFAIK).
So it does make sense to have this special sizetype (you could call it
intptr_t of course), and it might also make sense to treat overflow of
the signed
variant as wrapping (though I'd argue we should match overflow behavior of
pointers as we mainly use sizetypes to offset pointers or compute differences
of them - which would make overflow of sizetypes undefined and not wrapping).

Richard.



More information about the Gcc-patches mailing list