Concretize gimple_cond_set_code
commitf4ca3cdc5a478923cd46f6925e1d38c998db345b
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 20 Dec 2013 18:35:12 +0000 (20 13:35 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 24 Oct 2014 21:25:21 +0000 (24 17:25 -0400)
tree79fb17906a73161d4f595b022612a7c160288098
parent4f0e11d4fcfa9aa3da2333e535979e60230b4dca
Concretize gimple_cond_set_code

This corresponds to:
  [PATCH 74/89] Concretize gimple_cond_set_code
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01209.html
from the original 89-patch kit

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

gcc/
* gimple.h (gimple_cond_set_code): Require a gimple_cond.

* tree-complex.c (expand_complex_comparison): Add a checked cast to
gimple_cond within "case GIMPLE_COND".

* tree-ssa-loop-ivcanon.c (create_canonical_iv): Convert local "cond"
to a gimple_cond, adding a checked cast.  The existing code requires
that the last statement before the exit edge have code GIMPLE_COND,
though it's not clear to me where this is verified.

* tree-ssa-loop-ivopts.c (rewrite_use_compare): Add a checked cast
to gimple_cond on "use->stmt".

* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Convert
local "exit_if" to gimple_cond, adding a checked cast.  It's not
clear to me exactly where the GIMPLE_COND-ness of this is
established, but the existing code requires it.
(canonicalize_loop_ivs): Similarly for "stmt".

* tree-ssa-propagate.c (propagate_tree_value_into_stmt): Replace
a check against GIMPLE_COND with a dyn_cast<gimple_cond>.
gcc/ChangeLog.gimple-classes
gcc/gimple.h
gcc/tree-complex.c
gcc/tree-ssa-loop-ivcanon.c
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa-loop-manip.c
gcc/tree-ssa-propagate.c