This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix optimization regression in constant folder

On 10/11/07, Michael Matz <> 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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]