From 04f8c98c5137cf912095bc623e09b34616fc2fe8 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 4 Jul 2018 12:56:48 +0000 Subject: [PATCH] re PR middle-end/86380 (incorrect comparison in function choose_multiplier) PR middle-end/86380 * expmed.c (choose_multiplier): Fix incorrect comparison with mask. From-SVN: r262401 --- gcc/ChangeLog | 5 +++++ gcc/expmed.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ff16010a0e..b8989153504 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-07-04 Eric Botcazou + + PR middle-end/86380 + * expmed.c (choose_multiplier): Fix incorrect comparison with mask. + 2018-07-04 Aldy Hernandez * tree-vrp.c (extract_range_from_binary_expr_1): Initialize diff --git a/gcc/expmed.c b/gcc/expmed.c index 4c74e7dc2ea..b01e1946898 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -3678,7 +3678,7 @@ choose_multiplier (unsigned HOST_WIDE_INT d, int n, int precision, { unsigned HOST_WIDE_INT mask = (HOST_WIDE_INT_1U << n) - 1; *multiplier_ptr = mhigh.to_uhwi () & mask; - return mhigh.to_uhwi () >= mask; + return mhigh.to_uhwi () > mask; } else { -- 2.30.2