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] Fix PR23128 and PR23129


Diego Novillo <dnovillo@redhat.com> writes:

> On Sat, Jul 30, 2005 at 10:31:07PM -0400, James A. Morrison wrote:
>
>> 	PR tree-optimization/23128
>> 	PR tree-optimization/23129
>> 	* tree-vrp.c (vrp_int_const_binop): Treat unsigned types like
>> 	flag_wrapv.
>>
> OK.
>
>> 	(extract_range_from_binary_expr): Set value range to varying for
>> 	divisions with anti-ranges.
>>
> OK.
>
>>	Set value range to varying for unsigned
>> 	addition and subtraction if it could wrap.
>>
> No.  Why wasn't TREE_OVERFLOW set when computing INF + INF?
> We rely on this bit to to set the result to VARYING near the end.
> In any case, such wrapping would have to be detected inside
> vrp_int_const_binop.

 The overflow detection code in fold detects signed overflow, but not unsigned
wrapping.  Take for example UINT_MAX + UINT_MAX, computed with signed
arithmetic we get -1 + -1 = -2, or UINT_MAX - 1 so no overflow has occured, but
we have wrapped.

>> 	(compare_ranges): Return false for EQ_EXPR if VR0 is less than VR1 or
>> 	vice-versa.
>> 
> Please submit separately.
>
> :REVIEWMAIL:
>


-- 
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]