gimple-fold.c (fold_gimple_cond): Do not require folding results to pass valid_gimple...
authorRichard Biener <rguenth@gcc.gnu.org>
Thu, 23 Jul 2015 13:33:43 +0000 (13:33 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 23 Jul 2015 13:33:43 +0000 (13:33 +0000)
2015-07-23  Richard Biener  <rguenther@suse.de>

* gimple-fold.c (fold_gimple_cond): Do not require folding
results to pass valid_gimple_rhs_p.
* tree-cfg.h (fold_cond_expr_cond): Remove.
* tree-cfg.c (fold_cond_expr_cond): Likewise.
(make_edges): Do not call it.
* tree-inline.c (tree_function_versioning): Likewise.

From-SVN: r226109

gcc/ChangeLog
gcc/gimple-fold.c
gcc/tree-cfg.c
gcc/tree-cfg.h
gcc/tree-inline.c

index 81c60beeba6d5dae09fd6bee262d19cb4eb1a337..f5bb227c33830b978d532b048150b8b15c8865bc 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-23  Richard Biener  <rguenther@suse.de>
+
+       * gimple-fold.c (fold_gimple_cond): Do not require folding
+       results to pass valid_gimple_rhs_p.
+       * tree-cfg.h (fold_cond_expr_cond): Remove.
+       * tree-cfg.c (fold_cond_expr_cond): Likewise.
+       (make_edges): Do not call it.
+       * tree-inline.c (tree_function_versioning): Likewise.
+
 2015-07-23  Tom de Vries  <tom@codesourcery.com>
 
        * tree-parloops.c (gather_scalar_reductions): Add arg to call to
@@ -8,7 +17,8 @@
        (vect_is_simple_reduction, vect_force_simple_reduction): Add and pass
        need_wrapping_integral_overflow parameter.
        (vectorizable_reduction): Add arg to call to vect_is_simple_reduction.
-       * tree-vectorizer.h (vect_force_simple_reduction): Add parameter to decl.
+       * tree-vectorizer.h (vect_force_simple_reduction): Add parameter to
+       decl.
 
 2015-07-23  Yuri Rumyantsev  <ysrumyan@gmail.com>
 
index e19700de2ab348078ed0d658231205ae8200e6bf..2909c42ef19a6dd8454232fc3194a9e53d9b9c7d 100644 (file)
@@ -546,7 +546,7 @@ fold_gimple_cond (gcond *stmt)
   if (result)
     {
       STRIP_USELESS_TYPE_CONVERSION (result);
-      if (is_gimple_condexpr (result) && valid_gimple_rhs_p (result))
+      if (is_gimple_condexpr (result))
         {
           gimple_cond_set_condition_from_tree (stmt, result);
           return true;
index d97b8240f228969e7133e5828fe3dcc9eb43376a..66f999e3c42d8d609dfc04dd36285847e69ccb9f 100644 (file)
@@ -606,48 +606,6 @@ create_bb (void *h, void *e, basic_block after)
                                 Edge creation
 ---------------------------------------------------------------------------*/
 
-/* Fold COND_EXPR_COND of each COND_EXPR.  */
-
-void
-fold_cond_expr_cond (void)
-{
-  basic_block bb;
-
-  FOR_EACH_BB_FN (bb, cfun)
-    {
-      gimple stmt = last_stmt (bb);
-
-      if (stmt && gimple_code (stmt) == GIMPLE_COND)
-       {
-         gcond *cond_stmt = as_a <gcond *> (stmt);
-         location_t loc = gimple_location (stmt);
-         tree cond;
-         bool zerop, onep;
-
-         fold_defer_overflow_warnings ();
-         cond = fold_binary_loc (loc, gimple_cond_code (cond_stmt),
-                                 boolean_type_node,
-                                 gimple_cond_lhs (cond_stmt),
-                                 gimple_cond_rhs (cond_stmt));
-         if (cond)
-           {
-             zerop = integer_zerop (cond);
-             onep = integer_onep (cond);
-           }
-         else
-           zerop = onep = false;
-
-         fold_undefer_overflow_warnings (zerop || onep,
-                                         stmt,
-                                         WARN_STRICT_OVERFLOW_CONDITIONAL);
-         if (zerop)
-           gimple_cond_make_false (cond_stmt);
-         else if (onep)
-           gimple_cond_make_true (cond_stmt);
-       }
-    }
-}
-
 /* If basic block BB has an abnormal edge to a basic block
    containing IFN_ABNORMAL_DISPATCHER internal call, return
    that the dispatcher's basic block, otherwise return NULL.  */
@@ -1000,9 +958,6 @@ make_edges (void)
   XDELETE (bb_to_omp_idx);
 
   free_omp_regions ();
-
-  /* Fold COND_EXPR_COND of each COND_EXPR.  */
-  fold_cond_expr_cond ();
 }
 
 /* Add SEQ after GSI.  Start new bb after GSI, and created further bbs as
index af58c80559d83ea36915a990d6c91eea9f91ffb6..6c4b1d9b241ddc6ca6a101f25a7e17e5587de3ee 100644 (file)
@@ -31,7 +31,6 @@ extern void gt_pch_nx (edge_def *e, gt_pointer_operator, void *);
 
 extern void init_empty_tree_cfg_for_function (struct function *);
 extern void init_empty_tree_cfg (void);
-extern void fold_cond_expr_cond (void);
 extern void start_recording_case_labels (void);
 extern void end_recording_case_labels (void);
 extern basic_block label_to_block_fn (struct function *, tree);
index 374b2463b7398eb531e33a19ac7f94ff9c0e2fa4..e1ceea417101a861a45ab630b7dbd4c6847875b6 100644 (file)
@@ -5847,7 +5847,6 @@ tree_function_versioning (tree old_decl, tree new_decl,
 
   fold_marked_statements (0, id.statements_to_fold);
   delete id.statements_to_fold;
-  fold_cond_expr_cond ();
   delete_unreachable_blocks_update_callgraph (&id);
   if (id.dst_node->definition)
     cgraph_edge::rebuild_references ();