OSDN Git Service

* gcc.dg/20020201-1.c: Use cleanup-coverage_files.
[pf3gnuchains/gcc-fork.git] / gcc / tree-cfg.c
index 56b7bc2..b1ff8e6 100644 (file)
@@ -457,9 +457,9 @@ fold_cond_expr_cond (void)
        {
          tree cond = fold (COND_EXPR_COND (stmt));
          if (integer_zerop (cond))
-           COND_EXPR_COND (stmt) = integer_zero_node;
+           COND_EXPR_COND (stmt) = boolean_false_node;
          else if (integer_onep (cond))
-           COND_EXPR_COND (stmt) = integer_one_node;
+           COND_EXPR_COND (stmt) = boolean_true_node;
        }
     }
 }
@@ -1189,7 +1189,7 @@ group_case_labels (void)
           i = 0;
          while (i < old_size - 1)
            {
-             tree base_case, base_label, base_high, type;
+             tree base_case, base_label, base_high;
              base_case = TREE_VEC_ELT (labels, i);
 
              gcc_assert (base_case);
@@ -1205,7 +1205,6 @@ group_case_labels (void)
                  continue;
                }
 
-             type = TREE_TYPE (CASE_LOW (base_case));
              base_high = CASE_HIGH (base_case) ?
                CASE_HIGH (base_case) : CASE_LOW (base_case);
              i++;
@@ -2377,20 +2376,11 @@ find_taken_edge_cond_expr (basic_block bb, tree val)
   edge true_edge, false_edge;
 
   extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
-
-  /* Otherwise, try to determine which branch of the if() will be taken.
-     If VAL is a constant but it can't be reduced to a 0 or a 1, then
-     we don't really know which edge will be taken at runtime.  This
-     may happen when comparing addresses (e.g., if (&var1 == 4)).  */
-  if (integer_nonzerop (val))
-    return true_edge;
-  else if (integer_zerop (val))
-    return false_edge;
-
-  gcc_unreachable ();
+  
+  gcc_assert (TREE_CODE (val) == INTEGER_CST);
+  return (zero_p (val) ? false_edge : true_edge);
 }
 
-
 /* Given an INTEGER_CST VAL and the entry block BB to a SWITCH_EXPR
    statement, determine which edge will be taken out of the block.  Return
    NULL if any edge may be taken.  */
@@ -3697,6 +3687,12 @@ verify_stmts (void)
        {
          int phi_num_args = PHI_NUM_ARGS (phi);
 
+         if (bb_for_stmt (phi) != bb)
+           {
+             error ("bb_for_stmt (phi) is set to a wrong basic block\n");
+             err |= true;
+           }
+
          for (i = 0; i < phi_num_args; i++)
            {
              tree t = PHI_ARG_DEF (phi, i);
@@ -3735,6 +3731,13 @@ verify_stmts (void)
       for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
        {
          tree stmt = bsi_stmt (bsi);
+
+         if (bb_for_stmt (stmt) != bb)
+           {
+             error ("bb_for_stmt (stmt) is set to a wrong basic block\n");
+             err |= true;
+           }
+
          bsi_next (&bsi);
          err |= verify_stmt (stmt, bsi_end_p (bsi));
          addr = walk_tree (&stmt, verify_node_sharing, htab, NULL);