Use precision and sign to compare types for ranges
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 22 Oct 2020 19:39:37 +0000 (15:39 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 22 Oct 2020 20:50:23 +0000 (16:50 -0400)
Updated to only use range_compatible_p in range assert sanity checks,
not for actual type cmpatibility.

* gimple-range-gori.cc (is_gimple_logical_p): Use types_compatible_p
for logical compatibility.
(logical_stmt_cache::cacheable_p): Ditto.

gcc/gimple-range-gori.cc

index 983f4c97e8790f0f0bb1b2114895acf4fd8b2fc4..5d50b111d2ae582f21f366f1bf4dbbee56fd7484 100644 (file)
@@ -552,7 +552,7 @@ is_gimple_logical_p (const gimple *gs)
        case BIT_AND_EXPR:
        case BIT_IOR_EXPR:
          // Bitwise operations on single bits are logical too.
-         if (range_compatible_p (TREE_TYPE (gimple_assign_rhs1 (gs)),
+         if (types_compatible_p (TREE_TYPE (gimple_assign_rhs1 (gs)),
                                  boolean_type_node))
            return true;
          break;
@@ -1165,7 +1165,7 @@ bool
 logical_stmt_cache::cacheable_p (gimple *stmt, const irange *lhs_range) const
 {
   if (gimple_code (stmt) == GIMPLE_ASSIGN
-      && range_compatible_p (TREE_TYPE (gimple_assign_lhs (stmt)),
+      && types_compatible_p (TREE_TYPE (gimple_assign_lhs (stmt)),
                             boolean_type_node)
       && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
     {