On Wed, 20 Jan 2021, Richard Sandiford wrote:
> Richard Biener writes:
> > diff --git a/gcc/hwint.h b/gcc/hwint.h
> > index 127b0130c66..8812bc7150f 100644
> > --- a/gcc/hwint.h
> > +++ b/gcc/hwint.h
> > @@ -333,4 +333,46 @@ absu_hwi (HOST_WIDE_INT x)
> >return x >= 0 ? (unsigned HOST_WIDE_IN
Richard Biener writes:
> diff --git a/gcc/hwint.h b/gcc/hwint.h
> index 127b0130c66..8812bc7150f 100644
> --- a/gcc/hwint.h
> +++ b/gcc/hwint.h
> @@ -333,4 +333,46 @@ absu_hwi (HOST_WIDE_INT x)
>return x >= 0 ? (unsigned HOST_WIDE_INT)x : -(unsigned HOST_WIDE_INT)x;
> }
>
> +/* Compute the
illa search finds wrong-code that's only fixed in 9.3+.
> So I guess I'll check for GCC 11+ then and not worry for stage1,
> non-bootstrapped GCC or crosses with host != GCC 11.
Like this. Bootstrapped / tested on x86_64-unknown-linux-gnu,
also covered add_hwi with __builtin_add_ove
On Wed, 20 Jan 2021, Jakub Jelinek wrote:
> On Wed, Jan 20, 2021 at 01:15:12PM +0100, Richard Biener wrote:
> > OK, fixed. Guess we could also use __builtin_mul_overflow directly
> > if supported via a GCC_VERSION check. Looks like it's present
> > since GCC 5 at least. So sth like (incremental
On Wed, Jan 20, 2021 at 01:15:12PM +0100, Richard Biener wrote:
> OK, fixed. Guess we could also use __builtin_mul_overflow directly
> if supported via a GCC_VERSION check. Looks like it's present
> since GCC 5 at least. So sth like (incremental)
>
> diff --git a/gcc/hwint.h b/gcc/hwint.h
> ind
On Wed, 20 Jan 2021, Jakub Jelinek wrote:
> On Wed, Jan 20, 2021 at 12:29:23PM +0100, Richard Biener wrote:
> > +/* Compute the product of signed A and B and indicate in *OVERFLOW whether
> > + that operation overflowed. */
> > +
> > +inline HOST_WIDE_INT
> > +mul_hwi (HOST_WIDE_INT a, HOST_WID
On Wed, Jan 20, 2021 at 12:29:23PM +0100, Richard Biener wrote:
> +/* Compute the product of signed A and B and indicate in *OVERFLOW whether
> + that operation overflowed. */
> +
> +inline HOST_WIDE_INT
> +mul_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow)
> +{
> + unsigned HOST_WIDE_I
The following tries to handle overflow in the integer computations
done by lambda ops of dependence analysis by failing instead of
silently continuing with overflowed values.
It also avoids treating large unsigned CHREC_RIGHT as negative
unless the chrec is of pointer type and avoids the most nega