This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix optimization regression in constant folder
"Richard Guenther" <firstname.lastname@example.org> writes:
> On 10/14/07, Eric Botcazou <email@example.com> wrote:
> > > The flags aren't fixed in stone. In fact, I just introduced them
> > > earlier this year. So all this tells me is that we need to change the
> > > flags. I already proposed such a change
> > > (http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00053.html). Nobody has
> > > yet explained why my proposal wouldn't work.
> > From my point of view, your proposal (TYPE_IGNORE_OVERFLOWS +
> > TYPE_OVERFLOW_WRAPS) is OK.
> I don't want to have TYPE_IGNORE_OVERFLOWS. Matters are complicated
> enough already. I also like you to revisit the decision to make Ada sizetype
> signed. If there are optimization regressions for expressions created by
> stor-layout.c solve them there, as that is the place where enough knowledge
> about the involved magnitudes is available.
The point of TYPE_IGNORE_OVERFLOWS is not for signed vs. unsigned, but
is rather to permit retaining the optimization currently done for
TYPE_IS_SIZE_TYPE in extract_muldiv_1.
If we have an unsigned type that is not a sizetype, we cannot do
this since it will change the result if the original computation
We don't want to set TYPE_OVERFLOW_UNDEFINED for sizetypes, because we
want to overflow to wrap, and in particular because we want to permit
reassociation. We need some way to indicate that this type does not