Re: [COMMITTED] frange::maybe_isnan() should return FALSE for undefined ranges.

2022-09-21 Thread Richard Biener via Gcc-patches
On Wed, Sep 21, 2022 at 9:52 AM Aldy Hernandez wrote: > > The reason the flags were uninitialized was because they were unused, > similarly for m_type. But you're right, it is icky and prone to bugs. > I just thought it was cheap to set_undefined by just flipping > m_kind=VR_UNDEFINED, but it

Re: [COMMITTED] frange::maybe_isnan() should return FALSE for undefined ranges.

2022-09-21 Thread Aldy Hernandez via Gcc-patches
The reason the flags were uninitialized was because they were unused, similarly for m_type. But you're right, it is icky and prone to bugs. I just thought it was cheap to set_undefined by just flipping m_kind=VR_UNDEFINED, but it smells like premature optimization. How about this? Aldy On Wed,

Re: [COMMITTED] frange::maybe_isnan() should return FALSE for undefined ranges.

2022-09-21 Thread Richard Biener via Gcc-patches
On Tue, Sep 20, 2022 at 8:23 PM Aldy Hernandez via Gcc-patches wrote: > > Undefined ranges have undefined NAN bits. We can't depend on them, > as they may contain garbage. Ick ;) Can you add a comment at least? > This patch returns false from > maybe_isnan() for undefined ranges (the empty

[COMMITTED] frange::maybe_isnan() should return FALSE for undefined ranges.

2022-09-20 Thread Aldy Hernandez via Gcc-patches
Undefined ranges have undefined NAN bits. We can't depend on them, as they may contain garbage. This patch returns false from maybe_isnan() for undefined ranges (the empty set). gcc/ChangeLog: * value-range.h (frange::maybe_isnan): Return false for undefined ranges. ---