Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-05 Thread Aldy Hernandez
On 09/05/2018 10:57 AM, Michael Matz wrote: Hi, On Wed, 5 Sep 2018, Aldy Hernandez wrote: No apologies needed. I welcome all masochists to join me in my personal hell :). ;-) How can this test and following code catch all problematic cases? Assume a range of [253..257], truncating to

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-05 Thread Michael Matz
Hi, On Wed, 5 Sep 2018, Aldy Hernandez wrote: > No apologies needed. I welcome all masochists to join me in my personal hell > :). ;-) > > How can this test and following code catch all problematic cases? Assume > > a range of [253..257], truncating to 8 bits unsigned. The size of the > >

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-05 Thread Aldy Hernandez
On 09/05/2018 08:58 AM, Michael Matz wrote: Hi, On Tue, 4 Sep 2018, Aldy Hernandez wrote: to make the result ~[0, 5], is it? At least the original code dropped that to VARYING. For the same reason truncating [3, 765] from short to unsigned char isn't [3, 253]. But maybe I'm missing

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-05 Thread Michael Matz
Hi, On Tue, 4 Sep 2018, Aldy Hernandez wrote: > > to make the result ~[0, 5], is it? At least the original code dropped > > that to VARYING. For the same reason truncating [3, 765] from > > short to unsigned char isn't [3, 253]. But maybe I'm missing something. Sorry for chiming in, but this

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Aldy Hernandez
On 09/04/2018 10:20 AM, Richard Biener wrote: On Tue, Sep 4, 2018 at 4:12 PM Aldy Hernandez wrote: I honestly don't remember exactly but I suppose precision mismatched somehow. Your code was OK with not using widest_ints. Ah, this got lost in the noise. Sorry. Will commit the

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Aldy Hernandez
On 09/04/2018 10:20 AM, Richard Biener wrote: On Tue, Sep 4, 2018 at 4:12 PM Aldy Hernandez wrote: On 09/04/2018 08:49 AM, Richard Biener wrote: On Tue, Sep 4, 2018 at 2:41 PM Aldy Hernandez wrote: On 09/04/2018 07:58 AM, Richard Biener wrote: On Mon, Sep 3, 2018 at 1:32 PM Aldy

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Richard Biener
On Tue, Sep 4, 2018 at 4:12 PM Aldy Hernandez wrote: > > > > On 09/04/2018 08:49 AM, Richard Biener wrote: > > On Tue, Sep 4, 2018 at 2:41 PM Aldy Hernandez wrote: > >> > >> > >> > >> On 09/04/2018 07:58 AM, Richard Biener wrote: > >>> On Mon, Sep 3, 2018 at 1:32 PM Aldy Hernandez wrote: >

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Aldy Hernandez
On 09/04/2018 08:49 AM, Richard Biener wrote: On Tue, Sep 4, 2018 at 2:41 PM Aldy Hernandez wrote: On 09/04/2018 07:58 AM, Richard Biener wrote: On Mon, Sep 3, 2018 at 1:32 PM Aldy Hernandez wrote: On 08/28/2018 05:27 AM, Richard Biener wrote: On Mon, Aug 27, 2018 at 2:24 PM Aldy

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Richard Biener
On Tue, Sep 4, 2018 at 2:41 PM Aldy Hernandez wrote: > > > > On 09/04/2018 07:58 AM, Richard Biener wrote: > > On Mon, Sep 3, 2018 at 1:32 PM Aldy Hernandez wrote: > >> > >> > >> > >> On 08/28/2018 05:27 AM, Richard Biener wrote: > >>> On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez wrote: >

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Aldy Hernandez
On 09/04/2018 07:58 AM, Richard Biener wrote: On Mon, Sep 3, 2018 at 1:32 PM Aldy Hernandez wrote: On 08/28/2018 05:27 AM, Richard Biener wrote: On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez wrote: Howdy! Phew, I think this is the last abstraction. This handles the unary

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-04 Thread Richard Biener
On Mon, Sep 3, 2018 at 1:32 PM Aldy Hernandez wrote: > > > > On 08/28/2018 05:27 AM, Richard Biener wrote: > > On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez wrote: > >> > >> Howdy! > >> > >> Phew, I think this is the last abstraction. This handles the unary > >> CONVERT_EXPR_P code. > >> > >>

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-09-03 Thread Aldy Hernandez
On 08/28/2018 05:27 AM, Richard Biener wrote: On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez wrote: Howdy! Phew, I think this is the last abstraction. This handles the unary CONVERT_EXPR_P code. It's the usual story-- normalize the symbolics to [-MIN,+MAX] and handle everything

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-08-29 Thread Bernhard Reutner-Fischer
On 27 August 2018 14:24:33 CEST, Aldy Hernandez wrote: >Howdy! > >Phew, I think this is the last abstraction. This handles the unary >CONVERT_EXPR_P code. +bool +wide_int_range_convert_tree (tree , tree , +tree outer_type, +signop

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-08-28 Thread Aldy Hernandez
On 08/28/2018 05:27 AM, Richard Biener wrote: On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez wrote: Howdy! Phew, I think this is the last abstraction. This handles the unary CONVERT_EXPR_P code. It's the usual story-- normalize the symbolics to [-MIN,+MAX] and handle everything

Re: VRP: abstract out wide int CONVERT_EXPR_P code

2018-08-28 Thread Richard Biener
On Mon, Aug 27, 2018 at 2:24 PM Aldy Hernandez wrote: > > Howdy! > > Phew, I think this is the last abstraction. This handles the unary > CONVERT_EXPR_P code. > > It's the usual story-- normalize the symbolics to [-MIN,+MAX] and handle > everything generically. > > Normalizing the symbolics

VRP: abstract out wide int CONVERT_EXPR_P code

2018-08-27 Thread Aldy Hernandez
Howdy! Phew, I think this is the last abstraction. This handles the unary CONVERT_EXPR_P code. It's the usual story-- normalize the symbolics to [-MIN,+MAX] and handle everything generically. Normalizing the symbolics brought about some nice surprises. We now handle a few things we were