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


On 9/29/07, Eric Botcazou <ebotcazou@adacore.com> wrote:
> > I (and Roger in the past) try to get rid of them completely, so introducing
> > new dependence on this feature is exactly the opposite what I thought was
> > consensus.
>
> Are you sure about the "completely"?

Yes.  There is one thing we might need (or add, or retain), that is an
internal integral type of pointer size (for the sake of POINTER_PLUS_EXPR).
This type should have the same overflow behavior as pointers.  _BUT_,
conversion to or from integers should be disallowed.  Maybe this is the
real point of the badness of the current sizetype (and its interesting state
of overflow-is-defined-or-not) - we happily convert to/from it from/to other
integer types (and pointer types).  This makes it somewhat interesting
to speak about overflow that can never happen.

So, if you can make fold_convert assert that we never convert back
from sizetype to another integral type then the situation wrt overflow
may be fine ;)  But I bet you will get ICEs all over the place.
(Conversions to sizetype are fine, of course; conversions to pointer-type
from sizetype might be not avoidable as well)

Richard.

> > [Getting rid of the special size types would also automatically get rid
> > of another source of confusion, namely that those special types are
> > sign-extended independent of their signedness]
>
> That, I do recall, was an agreed-upon goal.
>
> --
> Eric Botcazou
>


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