On Thu, Dec 16, 2021 at 06:11:27AM +0530, Siddhesh Poyarekar wrote:
> On 12/16/21 00:13, Jakub Jelinek wrote:
> > On Wed, Dec 15, 2021 at 10:42:29PM +0530, Siddhesh Poyarekar wrote:
> > > On 12/15/21 20:51, Jakub Jelinek wrote:
> > > > Shouldn't this also tree_int_cst_compare (old_wholeval, wholeval) ?
> > > > 
> > > 
> > > AFAICT, there is no situation where wholeval changes but val doesn't, so I
> > > believe the val check should be sufficient.  Do you think otherwise?
> > 
> > Dunno, just something that caught my eye.
> 
> How about if I add an assert like so:
> 
>   if (tree_int_cst_compare (oldval, val))
>     return true;
>   else
>     {
>       gcc_checking_assert (tree_int_cst_compare (old_wholeval,
>                          wholeval) == 0);
>       return false;
>     }

Yes, but please fix up formatting, wholeval should go below old_wholeval.
Though, perhaps it would be better to:

  if (tree_int_cst_compare (oldval, val))
    return true;

  gcc_checking_assert (tree_int_cst_compare (old_wholeval, wholeval) == 0);
  return false;

Ok with that change.

        Jakub

Reply via email to