tree-ssa-uninit: clean up is_value_included_in
authorVladislav Ivanishin <vlad@ispras.ru>
Wed, 15 May 2019 12:40:04 +0000 (12:40 +0000)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Wed, 15 May 2019 12:40:04 +0000 (15:40 +0300)
2019-05-15  Vladislav Ivanishin  <vlad@ispras.ru>

* tree-ssa-uninit.c (is_value_included_in): Remove is_unsigned and merge
semantically equivalent branches (left over after prior refactorings).

From-SVN: r271207

gcc/ChangeLog
gcc/tree-ssa-uninit.c

index b531a2950ef997893a9b0af03d20414b811a145a..fe85101e4357481fa4c1c9f14e4427c92049b614 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-15  Vladislav Ivanishin  <vlad@ispras.ru>
+
+       * tree-ssa-uninit.c (is_value_included_in): Remove is_unsigned and merge
+       semantically equivalent branches (left over after prior refactorings).
+
 2019-05-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/88828
index 831587854c66d091ec3e1acc21c49d981b0141bf..7362e374dea752cd9760441ce682859a77eac8df 100644 (file)
@@ -1017,45 +1017,26 @@ static bool
 is_value_included_in (tree val, tree boundary, enum tree_code cmpc)
 {
   bool inverted = false;
-  bool is_unsigned;
   bool result;
 
   /* Only handle integer constant here.  */
   if (TREE_CODE (val) != INTEGER_CST || TREE_CODE (boundary) != INTEGER_CST)
     return true;
 
-  is_unsigned = TYPE_UNSIGNED (TREE_TYPE (val));
-
   if (cmpc == GE_EXPR || cmpc == GT_EXPR || cmpc == NE_EXPR)
     {
       cmpc = invert_tree_comparison (cmpc, false);
       inverted = true;
     }
 
-  if (is_unsigned)
-    {
-      if (cmpc == EQ_EXPR)
-       result = tree_int_cst_equal (val, boundary);
-      else if (cmpc == LT_EXPR)
-       result = tree_int_cst_lt (val, boundary);
-      else
-       {
-         gcc_assert (cmpc == LE_EXPR);
-         result = tree_int_cst_le (val, boundary);
-       }
-    }
+  if (cmpc == EQ_EXPR)
+    result = tree_int_cst_equal (val, boundary);
+  else if (cmpc == LT_EXPR)
+    result = tree_int_cst_lt (val, boundary);
   else
     {
-      if (cmpc == EQ_EXPR)
-       result = tree_int_cst_equal (val, boundary);
-      else if (cmpc == LT_EXPR)
-       result = tree_int_cst_lt (val, boundary);
-      else
-       {
-         gcc_assert (cmpc == LE_EXPR);
-         result = (tree_int_cst_equal (val, boundary)
-                   || tree_int_cst_lt (val, boundary));
-       }
+      gcc_assert (cmpc == LE_EXPR);
+      result = tree_int_cst_le (val, boundary);
     }
 
   if (inverted)