Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-20 Thread Aldy Hernandez via Gcc-patches
On Tue, Sep 20, 2022 at 5:10 PM Jakub Jelinek wrote: > > On Tue, Sep 20, 2022 at 04:58:38PM +0200, Aldy Hernandez wrote: > > > > > deal with NaNs just fine and is required to correctly capture the > > > > > sign of > > > > > 'x'. If frange::set_nonnegative is supposed to be used in such > > >

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-20 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 20, 2022 at 04:58:38PM +0200, Aldy Hernandez wrote: > > > > deal with NaNs just fine and is required to correctly capture the sign > > > > of > > > > 'x'. If frange::set_nonnegative is supposed to be used in such contexts > > > > (and I think it's a good idea if that were the case),

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-20 Thread Aldy Hernandez via Gcc-patches
On Tue, Sep 20, 2022 at 2:51 PM Michael Matz wrote: > > Hello, > > On Tue, 20 Sep 2022, Aldy Hernandez wrote: > > > > FWIW, in IEEE, 'abs' (like 'copy, 'copysign' and 'negate') are not > > > arithmetic, they are quiet-computational. Hence they don't rise > > > anything, not even for sNaNs; they

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-20 Thread Michael Matz via Gcc-patches
Hello, On Tue, 20 Sep 2022, Aldy Hernandez wrote: > > FWIW, in IEEE, 'abs' (like 'copy, 'copysign' and 'negate') are not > > arithmetic, they are quiet-computational. Hence they don't rise > > anything, not even for sNaNs; they copy the input bits and appropriately > > modify the bit pattern

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Aldy Hernandez via Gcc-patches
On Mon, Sep 19, 2022 at 3:42 PM Richard Biener wrote: > > On Mon, Sep 19, 2022 at 2:52 PM Aldy Hernandez wrote: > > > > On Mon, Sep 19, 2022 at 10:14 AM Richard Biener > > wrote: > > > > > > On Mon, Sep 19, 2022 at 9:59 AM Aldy Hernandez wrote: > > > > > > > > ISTM that a specifically

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Aldy Hernandez via Gcc-patches
On Mon, Sep 19, 2022 at 4:04 PM Michael Matz wrote: > > Hello, > > On Mon, 19 Sep 2022, Richard Biener via Gcc-patches wrote: > > > > but I guess it's good we do the right thing for correctness sake, and > > > if it ever gets used by someone else. > > > > > > > > > > > That said,

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Michael Matz via Gcc-patches
Hello, On Mon, 19 Sep 2022, Richard Biener via Gcc-patches wrote: > > but I guess it's good we do the right thing for correctness sake, and > > if it ever gets used by someone else. > > > > > > > > That said, 'set_nonnegative' could be interpreted to be without > > > NaNs? > > > > Sounds good to

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Richard Biener via Gcc-patches
On Mon, Sep 19, 2022 at 2:52 PM Aldy Hernandez wrote: > > On Mon, Sep 19, 2022 at 10:14 AM Richard Biener > wrote: > > > > On Mon, Sep 19, 2022 at 9:59 AM Aldy Hernandez wrote: > > > > > > ISTM that a specifically nonnegative range should not contain -NAN, > > > otherwise signbit_p() would

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Aldy Hernandez via Gcc-patches
On Mon, Sep 19, 2022 at 10:14 AM Richard Biener wrote: > > On Mon, Sep 19, 2022 at 9:59 AM Aldy Hernandez wrote: > > > > ISTM that a specifically nonnegative range should not contain -NAN, > > otherwise signbit_p() would return false, because we'd be unsure of the > > sign. > > > > Do y'all

Re: [PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Richard Biener via Gcc-patches
On Mon, Sep 19, 2022 at 9:59 AM Aldy Hernandez wrote: > > ISTM that a specifically nonnegative range should not contain -NAN, > otherwise signbit_p() would return false, because we'd be unsure of the > sign. > > Do y'all agree? what tree_expr_nonnegative_p actually means isn't 100% clear. For

[PATCH] [PR68097] frange::set_nonnegative should not contain -NAN.

2022-09-19 Thread Aldy Hernandez via Gcc-patches
ISTM that a specifically nonnegative range should not contain -NAN, otherwise signbit_p() would return false, because we'd be unsure of the sign. Do y'all agree? PR 68097/tree-optimization gcc/ChangeLog: * value-range.cc (frange::set_nonnegative): Set +NAN.