On Sat, Jul 15, 2017 at 11:47:45PM +0300, Alexander Monakov wrote:
> --- a/gcc/gimple-ssa-store-merging.c
> +++ b/gcc/gimple-ssa-store-merging.c
> @@ -516,12 +516,12 @@ sort_by_bitpos (const void *x, const void *y)
>    store_immediate_info *const *tmp = (store_immediate_info * const *) x;
>    store_immediate_info *const *tmp2 = (store_immediate_info * const *) y;
>  
> -  if ((*tmp)->bitpos <= (*tmp2)->bitpos)
> +  if ((*tmp)->bitpos < (*tmp2)->bitpos)
>      return -1;
>    else if ((*tmp)->bitpos > (*tmp2)->bitpos)
>      return 1;
> -
> -  gcc_unreachable ();
> +  else
> +    return 0;
>  }

Does any sort using this comparison function require the sort to be
stable?

It looks like the <= was simply a typo and should have been <, but
the gcc_unreachable was as intended?  (With <= it is trivially
unreachable there).


Segher

Reply via email to