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 incompare_range_with_value


Tom Truscott <trt@unx.sas.com> writes:

> Somewhat related to this (EQ/NE working the same way,
> it looks like the ordinary-range NE test is missing
> the case of [p,p] != q  detected by compare_values (p,q) returning +2

 I'm not quite sure what you mean but in compare_value_with_range at line 1779
NE_EXPR dealt with nicely for VR_RANGEs.  

> Perhaps the EQ_EXPR and NE_EXPR code on approx lines 1714..1747
> could be merged.  Change the separate ifs into:
>
>   if (comp == EQ_EXPR || comp == NE_EXPR)
>     {
>       ...
>           if (cmp == 0)
>             return comp == EQ_EXPR ? boolean_true_node : boolean_false_node;
>
> and so on.
>
> Tom Truscott

 I'm not a fan of trying to squish any of the code in compare_ranges, it's
nice and easy to read right now and I think trying to factor it as you suggest
above would cause confusion.

-- 
Thanks,
Jim

http://www.csclub.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim


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