This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Deal with larger anti-ranages in compare_range_with_value


Interestingly, the handy value_inside_range() also misses
the unordered p!=q case.  That is:

     value_inside_range(p, [q,q])

should return 0 when compare_values(p,q) returns +2.
So that function could do:

  ...
  cmp1 = compare_values (val, vr->min);
  if (compare_values (vr_min, vr->max) == 0)      /* NEW */
    return (cmp1 == -2) ? -2 : (cmp1 == 0);       /* NEW */
  if (cmp1 == -2 || cmp1 == 2)
  ...

Tom Truscott


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]