[range-ops] Minor readability fix.
Commit Message
I know it's past the end of stage1, but I'm afraid we'll drag this
around forever in the GCC12 branch, and it's an easy readbility fix.
p.s. Or if you prefer:
if (!lb_nan && !ub_nan && !maybe_nan && ....)
r.clear_nan ();
OK for trunk?
gcc/ChangeLog:
* range-op-float.cc (range_operator_float::fold_range): Make check
for maybe_isnan more readable.
---
gcc/range-op-float.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On 11/15/22 09:31, Aldy Hernandez via Gcc-patches wrote:
> I know it's past the end of stage1, but I'm afraid we'll drag this
> around forever in the GCC12 branch, and it's an easy readbility fix.
>
> p.s. Or if you prefer:
>
> if (!lb_nan && !ub_nan && !maybe_nan && ....)
> r.clear_nan ();
>
> OK for trunk?
>
> gcc/ChangeLog:
>
> * range-op-float.cc (range_operator_float::fold_range): Make check
> for maybe_isnan more readable.
Your call. I think we're so early in stage3 that if you think this is
uber-safe go for it.
jeff
@@ -83,10 +83,12 @@ range_operator_float::fold_range (frange &r, tree type,
r.set (type, lb, ub);
- if (lb_nan || ub_nan || maybe_nan)
+ if (lb_nan || ub_nan || maybe_nan
+ || op1.maybe_isnan ()
+ || op2.maybe_isnan ())
// Keep the default NAN (with a varying sign) set by the setter.
;
- else if (!op1.maybe_isnan () && !op2.maybe_isnan ())
+ else
r.clear_nan ();
return true;