]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make fold_cond_with_ops use a boolean type for range_true/range_false.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 7 Feb 2024 10:27:29 +0000 (11:27 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Sun, 28 Apr 2024 19:03:00 +0000 (21:03 +0200)
Conditional operators are always boolean, regardless of their
operands.  Getting the type wrong is not currently a problem, but will
be when prange's can no longer store an integer.

gcc/ChangeLog:

* vr-values.cc (simplify_using_ranges::fold_cond_with_ops): Remove
type from range_true and range_false.

gcc/vr-values.cc

index a7e291a16e52c53c22d8bd3180fab0afaeab6a05..ff68d40c3551f21f2baf5e13aeee59f5a79e6fb2 100644 (file)
@@ -320,9 +320,9 @@ simplify_using_ranges::fold_cond_with_ops (enum tree_code code,
   range_op_handler handler (code);
   if (handler && handler.fold_range (res, type, r0, r1))
     {
-      if (res == range_true (type))
+      if (res == range_true ())
        return boolean_true_node;
-      if (res == range_false (type))
+      if (res == range_false ())
        return boolean_false_node;
     }
   return NULL;