aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-07-04 12:56:48 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-07-04 12:56:48 +0000
commit04f8c98c5137cf912095bc623e09b34616fc2fe8 (patch)
tree727d0a38f6a8fda63eed7cca05fc53d467ea0508
parentaacd59e7513d1de99a12f2794353f2d548c929d4 (diff)
downloadgcc-04f8c98c5137cf912095bc623e09b34616fc2fe8.zip
gcc-04f8c98c5137cf912095bc623e09b34616fc2fe8.tar.gz
gcc-04f8c98c5137cf912095bc623e09b34616fc2fe8.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expmed.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5ff1601..b898915 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/86380
+ * expmed.c (choose_multiplier): Fix incorrect comparison with mask.
+
2018-07-04 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (extract_range_from_binary_expr_1): Initialize
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 4c74e7dc..b01e194 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
{