aboutsummaryrefslogtreecommitdiff
path: root/gcc/wide-int.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-01-27 12:40:04 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-01-27 12:40:04 +0100
commitb1652ddea99943a7a6df4be25e3a35e4eeeeb86d (patch)
treebce699e60643f9feadb835a3de8da891519c2eca /gcc/wide-int.h
parentdfa654c8cf28dc2f85ccb45b85de3ee26edcc580 (diff)
downloadgcc-b1652ddea99943a7a6df4be25e3a35e4eeeeb86d.zip
gcc-b1652ddea99943a7a6df4be25e3a35e4eeeeb86d.tar.gz
gcc-b1652ddea99943a7a6df4be25e3a35e4eeeeb86d.tar.bz2
re PR tree-optimization/69399 (wrong code with -O and int128)
PR tree-optimization/69399 * wide-int.h (wi::lrshift): For larger precisions, only use fast path if shift is known to be < HOST_BITS_PER_WIDE_INT. * gcc.dg/torture/pr69399.c: New test. From-SVN: r232869
Diffstat (limited to 'gcc/wide-int.h')
-rw-r--r--gcc/wide-int.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/wide-int.h b/gcc/wide-int.h
index 56cf582..fa133f0 100644
--- a/gcc/wide-int.h
+++ b/gcc/wide-int.h
@@ -2909,7 +2909,9 @@ wi::lrshift (const T1 &x, const T2 &y)
For variable-precision integers like wide_int, handle HWI
and sub-HWI integers inline. */
if (STATIC_CONSTANT_P (xi.precision > HOST_BITS_PER_WIDE_INT)
- ? xi.len == 1 && xi.val[0] >= 0
+ ? (shift < HOST_BITS_PER_WIDE_INT
+ && xi.len == 1
+ && xi.val[0] >= 0)
: xi.precision <= HOST_BITS_PER_WIDE_INT)
{
val[0] = xi.to_uhwi () >> shift;