[PATCH] reorganize simplify_const_relational_operation

Eric Botcazou ebotcazou@libertysurf.fr
Wed Sep 19 14:05:00 GMT 2007


> int
> double_int_scmp (double_int a, double_int b)
> {
>    if (a.high < b.high)
>      return -1;
>    if (a.high > b.high)
>      return 1;
>    if ((HOST_WIDE_INT) a.low < (HOST_WIDE_INT) b.low)  /* oops? */
>      return -1;
>    if ((HOST_WIDE_INT) a.low > (HOST_WIDE_INT) b.low)  /* oops? */
>      return 1;
>
>    return 0;
> }

What sources are you looking at exactly?  Mine read:

/* Compares two signed values A and B.  Returns -1 if A < B, 0 if A == B,
   and 1 if A > B.  */

int
double_int_scmp (double_int a, double_int b)
{
  if (a.high < b.high)
    return -1;
  if (a.high > b.high)
    return 1;
  if (a.low < b.low)
    return -1;
  if (a.low > b.low)
    return 1;

  return 0;
}

-- 
Eric Botcazou



More information about the Gcc-patches mailing list