[gcc r12-7265] Use range_compatible_p in condexpr_adjust

Andrew Macleod amacleod@gcc.gnu.org
Wed Feb 16 18:45:21 GMT 2022


https://gcc.gnu.org/g:fe581e63431bb1115d8a4945ba457f05e33dc6bb

commit r12-7265-gfe581e63431bb1115d8a4945ba457f05e33dc6bb
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Wed Feb 16 09:01:47 2022 -0500

    Use range_compatible_p in condexpr_adjust
    
            * gimple-range-gori.cc (gori_compute::condexpr_adjust): Use
            range_compatible_p instead of direct type comparison.

Diff:
---
 gcc/gimple-range-gori.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 258da6e7235..311214cc21d 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -1322,7 +1322,7 @@ gori_compute::condexpr_adjust (irange &r1, irange &r2, gimple *, tree cond,
   if (!COMPARISON_CLASS_P (cond))
     return false;
   tree type = TREE_TYPE (TREE_OPERAND (cond, 0));
-  if (type != TREE_TYPE (TREE_OPERAND (cond, 1)))
+  if (!range_compatible_p (type, TREE_TYPE (TREE_OPERAND (cond, 1))))
     return false;
   range_operator *hand = range_op_handler (TREE_CODE (cond), type);
   if (!hand)


More information about the Gcc-cvs mailing list