From 2b2f2ee49a33419f9d19f548e6a8ce520818a5d2 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Mon, 14 Nov 2022 10:29:13 +0100 Subject: [PATCH] [range-ops] Minor readability fix. 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(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 0c4ec8dd1782..adb0cbaa6d58 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -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;