This is the mail archive of the gcc-patches@gcc.gnu.org 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


> As we use sizetype for offsets of pointers choosing the size of pointers
> as the size of sizetypes would make sense for the middle-end.  

No, because there's no necessary reason why the size of addresses and
the sizes of offsets for addresses are the same!  That's true from a
definitional point of view, but also consider some of the mixed 32/64
systems, such as Alpha/VMS.  For example, in such a case do you mean
Pmode or ptr_mode?  There seems no reason to me to mix these
unrelated concepts (size of pointer and size of size_t).  And realize
that ptr_mode (which is most likely what you'd want, is ALSO a
front-end concept).

> I still don't see the connection to the signedness of sizetype though.

The range of a type (what values it can hold) is determined by both the
precision and the signedness.  size_t and sizetype must have the same range.


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