]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Copy range from op2 in foperator_equal::op1_range.
authorAldy Hernandez <aldyh@redhat.com>
Sat, 20 Aug 2022 10:41:27 +0000 (12:41 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 23 Aug 2022 10:17:09 +0000 (12:17 +0200)
Like the integer version, when op1 == op2 is known to be true the
ranges are also equal.

gcc/ChangeLog:

* range-op-float.cc (foperator_equal::op1_range): Set range to
range of op2.

gcc/range-op-float.cc

index 4fbd96a74797426d0017ba072f3b21395021c21e..ad2fae578d21cbed2445506a70a9984a61da9ec1 100644 (file)
@@ -252,7 +252,8 @@ foperator_equal::op1_range (frange &r, tree type,
   switch (get_bool_state (r, lhs, type))
     {
     case BRS_TRUE:
-      r.set_varying (type);
+      // If it's true, the result is the same as OP2.
+      r = op2;
       // The TRUE side of op1 == op2 implies op1 is !NAN.
       r.set_nan (fp_prop::NO);
       break;