From: Marc Glisse Date: Wed, 10 Jul 2019 15:16:12 +0000 (+0200) Subject: Fix wi::lshift X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12bb04368e7fcbdd8d3744a440eee23c9293958f;p=gcc.git Fix wi::lshift 2019-07-10 Marc Glisse * wide-int.h (wi::lshift): Reject negative values for the fast path. From-SVN: r273356 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b32482db5f..f109a8cc5ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-07-10 Marc Glisse + + * wide-int.h (wi::lshift): Reject negative values for the fast path. + 2019-07-10 Richard Biener PR tree-optimization/91126 diff --git a/gcc/wide-int.h b/gcc/wide-int.h index bb8ced12350..6c816cc260b 100644 --- a/gcc/wide-int.h +++ b/gcc/wide-int.h @@ -3034,8 +3034,7 @@ wi::lshift (const T1 &x, const T2 &y) if (STATIC_CONSTANT_P (xi.precision > HOST_BITS_PER_WIDE_INT) ? (STATIC_CONSTANT_P (shift < HOST_BITS_PER_WIDE_INT - 1) && xi.len == 1 - && xi.val[0] <= (HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) - HOST_WIDE_INT_MAX >> shift)) + && IN_RANGE (xi.val[0], 0, HOST_WIDE_INT_MAX >> shift)) : precision <= HOST_BITS_PER_WIDE_INT) { val[0] = xi.ulow () << shift;