diff mbox series

[COMMITTED,07/16] Make fold_cond_with_ops use a boolean type for range_true/range_false.

Message ID 20240428190557.1209586-8-aldyh@redhat.com
State New
Headers show
Series prange supporting patchset | expand

Commit Message

Aldy Hernandez April 28, 2024, 7:05 p.m. UTC
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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc
index a7e291a16e5..ff68d40c355 100644
--- a/gcc/vr-values.cc
+++ b/gcc/vr-values.cc
@@ -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;