Hi!

On Mon, 23 Oct 2017 18:17:38 +0100, Richard Sandiford 
<richard.sandif...@linaro.org> wrote:
> This patch makes get_inner_reference and ptr_difference_const return the
> bit size and bit position as poly_int64s rather than HOST_WIDE_INTS.
> The non-mechanical changes were handled by previous patches.

(A variant of that got committed to trunk in r255914.)

> --- gcc/gimplify.c    2017-10-23 17:11:40.246949037 +0100
> +++ gcc/gimplify.c    2017-10-23 17:18:47.663057272 +0100

> @@ -8056,13 +8056,13 @@ gimplify_scan_omp_clauses (tree *list_p,

> -                         if (bitpos2)
> -                           o2 = o2 + bitpos2 / BITS_PER_UNIT;
> -                         if (wi::ltu_p (o1, o2)
> -                             || (wi::eq_p (o1, o2) && bitpos < bitpos2))
> +                         o2 += bits_to_bytes_round_down (bitpos2);
> +                         if (may_lt (o1, o2)
> +                             || (must_eq (o1, 2)
> +                                 && may_lt (bitpos, bitpos2)))
>                             {

("must_eq" is nowadays known as "known_eq".)  As Julian points out in
<https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00824.html> (thanks!,
but please, bug fixes separate from code refactoring), there is an
'apparent bug introduced [...]: "known_eq (o1, 2)" should have been
"known_eq (o1, o2)"'.

I have not searched now for any other such issues -- could this one have
been (or, any others now be) found automatically?

OK to fix (on all relevant branches) this as in the patch attached?  If
approving this patch, please respond with "Reviewed-by: NAME <EMAIL>" so
that your effort will be recorded in the commit log, see
<https://gcc.gnu.org/wiki/Reviewed-by>.


Grüße
 Thomas


>From 0396c4087114d4a63824d89ff33110b76d607768 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Fri, 21 Dec 2018 11:58:45 +0100
Subject: [PATCH] poly_int: get_inner_reference & co.: fix known_eq typo/bug

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Fix known_eq typo/bug.
---
 gcc/gimplify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 465d138abbed..40ed18e30271 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8719,7 +8719,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
 			      o2 = 0;
 			    o2 += bits_to_bytes_round_down (bitpos2);
 			    if (maybe_lt (o1, o2)
-				|| (known_eq (o1, 2)
+				|| (known_eq (o1, o2)
 				    && maybe_lt (bitpos, bitpos2)))
 			      {
 				if (ptr)
-- 
2.17.1

Reply via email to