Concretize gimple_cond_make_{false|true}
commitea8bd2eaa829c9969aa56b117221803ff4d28a5b
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 20 Dec 2013 17:19:58 +0000 (20 12:19 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 24 Oct 2014 21:25:16 +0000 (24 17:25 -0400)
treeeeb50e914306f22fb1352d000b886f5d4ee80240
parent7adc5519dccf5bc28755edd0411037a3564f3983
Concretize gimple_cond_make_{false|true}

This corresponds to:
  [PATCH 71/89] Concretize gimple_cond_make_{false|true}
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01208.html
from the original 89-patch kit

That earlier patch was approved by Jeff:
> OK once prerequisites go in.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00863.html

gcc/
* gimple.h (gimple_cond_make_false): Require a gimple_cond.
(gimple_cond_make_true): Likewise.

* tree-cfg.c (fold_cond_expr_cond): Add a checked cast to
gimple_cond within region guarded by check for GIMPLE_COND.
* tree-ssa-ccp.c (ccp_fold_stmt): Likewise.

* tree-loop-distribution.c (generate_loops_for_partition): Replace
a check for GIMPLE_COND with a dyn_cast<gimple_cond>.
* tree-ssa-ccp.c (optimize_unreachable): Likewise.
* tree-ssa-loop-niter.c (number_of_iterations_exit): Likewise.
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Likewise.

* tree-vrp.c (fold_predicate_in): Add a checked cast to
gimple_cond.  We must be dealing with a GIMPLE_COND since logic
at top of the function ensures we only act on GIMPLE_ASSIGN and
GIMPLE_COND statements, and we're now within a "not a GIMPLE_ASSIGN"
clause.

* tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Add
checked cast of elt->stmt to gimple_cond.  The existing code requires
this to be a GIMPLE_COND, though it's not clear to me how this
requirement is enforced.
(remove_redundant_iv_tests): Likewise.
(try_unroll_loop_completely): Likewise, for the last_stmt of the
preceding bb along edge_to_cancel.
* tree-ssa-reassoc.c (maybe_optimize_range_tests): Likewise, for the
last_stmt of bb.
gcc/ChangeLog.gimple-classes
gcc/gimple.h
gcc/tree-cfg.c
gcc/tree-loop-distribution.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-loop-ivcanon.c
gcc/tree-ssa-loop-niter.c
gcc/tree-ssa-reassoc.c
gcc/tree-vrp.c