This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Deal with larger anti-ranages in compare_range_with_value
- From: Tom Truscott <trt at unx dot sas dot com>
- To: ja2morri at csclub dot uwaterloo dot ca (James A. Morrison)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Jul 2005 11:49:22 -0400 (EDT)
- Subject: 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