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 30 Sep 2007 15:51:02 -0700, Ian Lance Taylor <iant@google.com> wrote:
> Eric Botcazou <ebotcazou@adacore.com> writes:
>
> > Then I think that we should have
> >
> >   TYPE_IS_SIZETYPE => TYPE_OVERFLOW_WRAPS
> >   TYPE_IS_SIZETYPE => TYPE_OVERFLOW_UNDEFINED
> >   TYPE_IS_SIZETYPE => !TYPE_OVERFLOW_TRAPS
>
> That doesn't make sense: a type either wraps on overflow or is
> undefined on overflow.  I think TYPE_IS_SIZETYPE should imply
> TYPE_OVERFLOW_UNDEFINED.
>
> Richard's patch for PR 30364 should test TYPE_OVERFLOW_UNDEFINED, not
> TYPE_OVERFLOW_WRAPS.

No, it should test !TYPE_OVERFLOW_WRAPS as it does.  The transformation
we do is only valid, if the overflow wraps.  It is not valid if it is merely not
undefined (for example it is invalid if overflow would saturate).

Sorry,
Richard.


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