This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Fix PR23128 and PR23129
- From: ja2morri at csclub dot uwaterloo dot ca (James A. Morrison)
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Jul 2005 23:07:43 -0400
- Subject: Re: [Patch] Fix PR23128 and PR23129
- References: <kfh1x5fwvtg.fsf@csclub.uwaterloo.ca><20050801025843.GA30982@topo.toronto.redhat.com>
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