gcc/
        * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
        to gimple_assign.

        * gimple-ssa-isolate-paths.c
        (insert_trap_and_remove_trailing_statements): Strengthen local
        "new_stmt" from gimple to gimple_call.

        * gimple-ssa-strength-reduction.c (replace_mult_candidate):
        Strengthen local "copy_stmt" from gimple to gimple_assign.
        (create_add_on_incoming_edge): Likewise, for "new_stmt".
        (insert_initializers): Likewise, for "init_stmt".
        (introduce_cast_before_cand): Likewise, for "cast_stmt".
        (replace_one_candidate): Likewise, for "copy_stmt" and
        "cast_stmt".

        * gimplify.c (build_stack_save_restore): Require gimple_calls
        rather than plain gimples.
        (gimplify_bind_expr): Strengthen locals "stack_save" and
        "stack_restore" from gimple to gimple_call.  Strengthen "gs"
        to gimple_try.
        (gimplify_switch_expr): Strengthen local "gimple_switch" from
        gimple to gimple_switch, and "new_default" to gimple_label.
        (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
        to gimple_cond.
        (gimplify_init_constructor): Strengthen local "init" from gimple
        to gimple_assign.
        (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
        to gimple_try.
        (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
        gimple to gimple_assign.

        * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
        (emit_post_landing_pad): Strengthen local to gimple_label.

        * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
        "stmt" from gimple to gimple_assign.

        * tree-parloops.c (take_address_of): Likewise.

        * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
        (initialize_root_vars_lm): Likewise, for "init_stmt".
        (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".

        * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
        "stmt2", "stmt3".
        (gimple_gen_ic_profiler): Likewise.
        (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
        gimple to gimple_call, and "stmt2" to gimple_assign.

        * tree-scalar-evolution.c (scev_const_prop): Strengthen local
        "ass" from gimple to gimple_assign.

        * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
        (generate_subtree_copies): Likewise; also strengthen "ds" to
        gimple_debug.
        (init_subtree_with_zero): Likewise.
        (sra_modify_expr): Likewise.
        (load_assign_lhs_subreplacements): Likewise.
        (sra_modify_assign): Strengthen "ds" to gimple_debug.
        (sra_ipa_reset_debug_stmts): Likewise for "def_temp".

        * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
        Strengthen local "clobber_stmt" from gimple to gimple_assign.

        * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
        gimple_debug.

        * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
        local "new_stmt" from gimple to gimple_assign.
        (optimize_stmt): Likewise.

        * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
        4 declarations of "newop".
        (simplify_rotate): Likewise for "g".

        * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
        (rewrite_bittest): Likewise for "stmt" and "stmt2".
        (move_computations_dom_walker::before_dom_children): Likewise for
        "new_stmt".
        (execute_sm): Likewise for "load" and "store".

        * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
        Strengthen local "stmt" from gimple to gimple_call.
        (unloop_loops): Likewise.

        * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
        local "ass" from gimple to gimple_assign.
        (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.

        * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
        from gimple to gimple_assign.

        * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
        "prefetch" from gimple to gimple_call.

        * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
        "new_stmt" from gimple to gimple_assign.
        (powi_as_mults_1): Likewise for "mult_stmt".
        (powi_as_mults): Likewise for "div_stmt".
        (build_and_insert_binop): Likewise for "stmt".
        (build_and_insert_cast): Likewise.
        (execute_cse_sincos): Likewise for "stmt" and various decls of
        "new_stmt".
        (execute_optimize_bswap): Likewise for two decls of "convert_stmt".
        (convert_mult_to_fma): Likewise for "fma_stmt".

        * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
        (abs_replacement): Likewise.

        * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".

        * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
        (eliminate_insert): Likewise for "tem".

        * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
        "new_stmt" and "stmt" from gimple to gimple_call.
        (update_call_from_tree): Likewise for "new_stmt".
        (substitute_and_fold): Strengthen local "new_stmt" from gimple to
        gimple_assign.

        * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
        (update_ops): Likewise for "g".
        (maybe_optimize_range_tests): Likewise.
        (rewrite_expr_tree_parallel): Require a gimple_assign rather than
        a plain gimple.
        (reassociate_bb): Add a checked cast to gimple_assign.

        * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
        "def_temp" from gimple to gimple_debug.

        * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
        "shift_stmt" from gimple to gimple_assign.

        * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
        "stmt".
        (update_accumulator_with_ops): Likewise.

        * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
        "incr_stmt".

        * tree-vect-stmts.c (vectorizable_condition): Likewise for
        "new_stmt".

        * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
        (simplify_truth_ops_using_ranges): Likewise for "newop".
        (simplify_float_conversion_using_ranges): Likewise for "conv".

        * ubsan.c (instrument_member_call): Strengthen local "g" from
        gimple to gimple_call.
        (instrument_mem_ref): Likewise.

        * value-prof.c (gimple_divmod_fixed_value): Require a
        gimple_assign rather than a plain gimple; strengthen types of locals.
        (gimple_mod_pow2): Likewise.
        (gimple_mod_subtract): Likewise.
        (gimple_divmod_fixed_value_transform): Strengthen local
        "stmt" from gimple to gimple_assign.
        (gimple_mod_pow2_value_transform): Likewise.
        (gimple_mod_subtract_transform): Likewise.
        (gimple_ic): Strengthen types of locals.
---
 gcc/cgraphunit.c                    |  2 +-
 gcc/gimple-ssa-isolate-paths.c      |  2 +-
 gcc/gimple-ssa-strength-reduction.c | 17 +++++++------
 gcc/gimplify.c                      | 22 ++++++++---------
 gcc/tree-eh.c                       |  4 +--
 gcc/tree-outof-ssa.c                |  3 ++-
 gcc/tree-parloops.c                 |  2 +-
 gcc/tree-predcom.c                  |  6 ++---
 gcc/tree-profile.c                  |  7 +++---
 gcc/tree-scalar-evolution.c         |  2 +-
 gcc/tree-sra.c                      | 35 ++++++++++++++------------
 gcc/tree-ssa-ccp.c                  |  3 ++-
 gcc/tree-ssa-dce.c                  |  2 +-
 gcc/tree-ssa-dom.c                  |  4 +--
 gcc/tree-ssa-forwprop.c             | 10 ++++----
 gcc/tree-ssa-loop-im.c              | 17 +++++++------
 gcc/tree-ssa-loop-ivcanon.c         |  4 +--
 gcc/tree-ssa-loop-ivopts.c          |  5 ++--
 gcc/tree-ssa-loop-manip.c           |  2 +-
 gcc/tree-ssa-loop-prefetch.c        |  2 +-
 gcc/tree-ssa-math-opts.c            | 27 +++++++++++---------
 gcc/tree-ssa-phiopt.c               |  6 +++--
 gcc/tree-ssa-phiprop.c              |  2 +-
 gcc/tree-ssa-pre.c                  |  9 ++++---
 gcc/tree-ssa-propagate.c            |  6 ++---
 gcc/tree-ssa-reassoc.c              | 14 ++++++-----
 gcc/tree-ssa.c                      |  2 +-
 gcc/tree-switch-conversion.c        |  2 +-
 gcc/tree-tailcall.c                 |  4 +--
 gcc/tree-vect-data-refs.c           |  2 +-
 gcc/tree-vect-stmts.c               |  2 +-
 gcc/tree-vrp.c                      |  7 +++---
 gcc/ubsan.c                         |  5 ++--
 gcc/value-prof.c                    | 49 +++++++++++++++++++++----------------
 34 files changed, 158 insertions(+), 130 deletions(-)

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index dea6335..289b959 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1360,7 +1360,7 @@ thunk_adjust (gimple_stmt_iterator * bsi,
              tree ptr, bool this_adjusting,
              HOST_WIDE_INT fixed_offset, tree virtual_offset)
 {
-  gimple stmt;
+  gimple_assign stmt;
   tree ret;
 
   if (this_adjusting
diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c
index 4e2b8a8..62298f6 100644
--- a/gcc/gimple-ssa-isolate-paths.c
+++ b/gcc/gimple-ssa-isolate-paths.c
@@ -94,7 +94,7 @@ insert_trap_and_remove_trailing_statements 
(gimple_stmt_iterator *si_p, tree op)
       update_stmt (stmt);
     }
 
-  gimple new_stmt
+  gimple_call new_stmt
     = gimple_build_call (builtin_decl_explicit (BUILT_IN_TRAP), 0);
   gimple_seq seq = NULL;
   gimple_seq_add_stmt (&seq, new_stmt);
diff --git a/gcc/gimple-ssa-strength-reduction.c 
b/gcc/gimple-ssa-strength-reduction.c
index 9320b51..35e15e0 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -2058,7 +2058,7 @@ replace_mult_candidate (slsr_cand_t c, tree basis_name, 
double_int bump)
       if (bump.is_zero ())
        {
          tree lhs = gimple_assign_lhs (c->cand_stmt);
-         gimple copy_stmt = gimple_build_assign (lhs, basis_name);
+         gimple_assign copy_stmt = gimple_build_assign (lhs, basis_name);
          gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
          gimple_set_location (copy_stmt, gimple_location (c->cand_stmt));
          gsi_replace (&gsi, copy_stmt, false);
@@ -2159,7 +2159,7 @@ create_add_on_incoming_edge (slsr_cand_t c, tree 
basis_name,
   basic_block insert_bb;
   gimple_stmt_iterator gsi;
   tree lhs, basis_type;
-  gimple new_stmt;
+  gimple_assign new_stmt;
 
   /* If the add candidate along this incoming edge has the same
      index as C's hidden basis, the hidden basis represents this
@@ -3118,7 +3118,7 @@ insert_initializers (slsr_cand_t c)
     {
       basic_block bb;
       slsr_cand_t where = NULL;
-      gimple init_stmt;
+      gimple_assign init_stmt;
       tree stride_type, new_name, incr_tree;
       double_int incr = incr_vec[i].incr;
 
@@ -3256,7 +3256,7 @@ static tree
 introduce_cast_before_cand (slsr_cand_t c, tree to_type, tree from_expr)
 {
   tree cast_lhs;
-  gimple cast_stmt;
+  gimple_assign cast_stmt;
   gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
 
   cast_lhs = make_temp_ssa_name (to_type, NULL, "slsr");
@@ -3418,7 +3418,7 @@ replace_one_candidate (slsr_cand_t c, unsigned i, tree 
basis_name)
       
       if (types_compatible_p (lhs_type, basis_type))
        {
-         gimple copy_stmt = gimple_build_assign (lhs, basis_name);
+         gimple_assign copy_stmt = gimple_build_assign (lhs, basis_name);
          gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
          gimple_set_location (copy_stmt, gimple_location (c->cand_stmt));
          gsi_replace (&gsi, copy_stmt, false);
@@ -3430,9 +3430,10 @@ replace_one_candidate (slsr_cand_t c, unsigned i, tree 
basis_name)
       else
        {
          gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
-         gimple cast_stmt = gimple_build_assign_with_ops (NOP_EXPR, lhs,
-                                                          basis_name,
-                                                          NULL_TREE);
+         gimple_assign cast_stmt =
+           gimple_build_assign_with_ops (NOP_EXPR, lhs,
+                                         basis_name,
+                                         NULL_TREE);
          gimple_set_location (cast_stmt, gimple_location (c->cand_stmt));
          gsi_replace (&gsi, cast_stmt, false);
          c->cand_stmt = cast_stmt;
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 520e71e..f8c3aff 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1003,7 +1003,7 @@ voidify_wrapper_expr (tree wrapper, tree temp)
    a temporary through which they communicate.  */
 
 static void
-build_stack_save_restore (gimple *save, gimple *restore)
+build_stack_save_restore (gimple_call *save, gimple_call *restore)
 {
   tree tmp_var;
 
@@ -1026,7 +1026,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
   tree t;
   gimple_bind gimple_bind;
   gimple_seq body, cleanup;
-  gimple stack_save;
+  gimple_call stack_save;
 
   tree temp = voidify_wrapper_expr (bind_expr, NULL);
 
@@ -1083,7 +1083,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
   stack_save = NULL;
   if (gimplify_ctxp->save_stack)
     {
-      gimple stack_restore;
+      gimple_call stack_restore;
 
       /* Save stack on entry and restore it on exit.  Add a try_finally
         block to achieve this.  */
@@ -1115,7 +1115,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
 
   if (cleanup)
     {
-      gimple gs;
+      gimple_try gs;
       gimple_seq new_body;
 
       new_body = NULL;
@@ -1446,7 +1446,7 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
       vec<tree> labels;
       vec<tree> saved_labels;
       tree default_case = NULL_TREE;
-      gimple gimple_switch;
+      gimple_switch gimple_switch;
 
       /* If someone can be bothered to fill in the labels, they can
         be bothered to null out the body too.  */
@@ -1466,7 +1466,7 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
 
       if (!default_case)
        {
-         gimple new_default;
+         gimple_label new_default;
 
          default_case
            = build_case_label (NULL_TREE, NULL_TREE,
@@ -2898,7 +2898,7 @@ gimplify_cond_expr (tree *expr_p, gimple_seq *pre_p, 
fallback_t fallback)
   enum gimplify_status ret;
   tree label_true, label_false, label_cont;
   bool have_then_clause_p, have_else_clause_p;
-  gimple gimple_cond;
+  gimple_cond gimple_cond;
   enum tree_code pred_code;
   gimple_seq seq = NULL;
 
@@ -4002,7 +4002,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq 
*pre_p, gimple_seq *post_p,
        {
          tree lhs = TREE_OPERAND (*expr_p, 0);
          tree rhs = TREE_OPERAND (*expr_p, 1);
-         gimple init = gimple_build_assign (lhs, rhs);
+         gimple_assign init = gimple_build_assign (lhs, rhs);
          gimplify_seq_add_stmt (pre_p, init);
          *expr_p = NULL;
        }
@@ -5151,7 +5151,7 @@ gimplify_cleanup_point_expr (tree *expr_p, gimple_seq 
*pre_p)
            }
          else
            {
-             gimple_statement_try *gtry;
+             gimple_try gtry;
              gimple_seq seq;
              enum gimple_try_flags kind;
 
@@ -5223,8 +5223,8 @@ gimple_push_cleanup (tree var, tree cleanup, bool 
eh_only, gimple_seq *pre_p)
           val
       */
       tree flag = create_tmp_var (boolean_type_node, "cleanup");
-      gimple ffalse = gimple_build_assign (flag, boolean_false_node);
-      gimple ftrue = gimple_build_assign (flag, boolean_true_node);
+      gimple_assign ffalse = gimple_build_assign (flag, boolean_false_node);
+      gimple_assign ftrue = gimple_build_assign (flag, boolean_true_node);
 
       cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
       gimplify_stmt (&cleanup, &cleanup_stmts);
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index ca8d4aa..70a284b 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -793,7 +793,7 @@ static void
 do_goto_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod,
                     struct leh_tf_state *tf)
 {
-  gimple x;
+  gimple_goto x;
 
   gcc_assert (q->is_label);
 
@@ -813,7 +813,7 @@ static void
 emit_post_landing_pad (gimple_seq *seq, eh_region region)
 {
   eh_landing_pad lp = region->landing_pads;
-  gimple x;
+  gimple_label x;
 
   if (lp == NULL)
     lp = gen_eh_landing_pad (region);
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 7f87ffc..026b048 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -1130,7 +1130,8 @@ insert_backedge_copies (void)
                      || trivially_conflicts_p (bb, result, arg)))
                {
                  tree name;
-                 gimple stmt, last = NULL;
+                 gimple_assign stmt;
+                 gimple last = NULL;
                  gimple_stmt_iterator gsi2;
 
                  gsi2 = gsi_last_bb (gimple_phi_arg_edge (phi, i)->src);
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index a142e96..dea9606 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -492,7 +492,7 @@ take_address_of (tree obj, tree type, edge entry,
   int_tree_map **dslot;
   struct int_tree_map ielt, *nielt;
   tree *var_p, name, addr;
-  gimple stmt;
+  gimple_assign stmt;
   gimple_seq stmts;
 
   /* Since the address of OBJ is invariant, the trees may be shared.
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index e95af52..9a5f317 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1293,7 +1293,7 @@ static void
 replace_ref_with (gimple stmt, tree new_tree, bool set, bool in_lhs)
 {
   tree val;
-  gimple new_stmt;
+  gimple_assign new_stmt;
   gimple_stmt_iterator bsi, psi;
 
   if (gimple_code (stmt) == GIMPLE_PHI)
@@ -1562,7 +1562,7 @@ initialize_root_vars_lm (struct loop *loop, dref root, 
bool written,
     }
   else
     {
-      gimple init_stmt = gimple_build_assign (var, init);
+      gimple_assign init_stmt = gimple_build_assign (var, init);
       gsi_insert_on_edge_immediate (entry, init_stmt);
     }
 }
@@ -2129,7 +2129,7 @@ static gimple
 reassociate_to_the_same_stmt (tree name1, tree name2)
 {
   gimple stmt1, stmt2, root1, root2, s1, s2;
-  gimple new_stmt, tmp_stmt;
+  gimple_assign new_stmt, tmp_stmt;
   tree new_name, tmp_name, var, r1, r2;
   unsigned dist1, dist2;
   enum tree_code code;
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index e79fedc..1a887a0 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -287,7 +287,7 @@ void
 gimple_gen_edge_profiler (int edgeno, edge e)
 {
   tree ref, one, gcov_type_tmp_var;
-  gimple stmt1, stmt2, stmt3;
+  gimple_assign stmt1, stmt2, stmt3;
 
   ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
   one = build_int_cst (gcov_type_node, 1);
@@ -395,7 +395,7 @@ void
 gimple_gen_ic_profiler (histogram_value value, unsigned tag, unsigned base)
 {
   tree tmp1;
-  gimple stmt1, stmt2, stmt3;
+  gimple_assign stmt1, stmt2, stmt3;
   gimple stmt = value->hvalue.stmt;
   gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
   tree ref_ptr = tree_coverage_counter_addr (tag, base);
@@ -431,7 +431,8 @@ gimple_gen_ic_func_profiler (void)
 {
   struct cgraph_node * c_node = cgraph_get_node (current_function_decl);
   gimple_stmt_iterator gsi;
-  gimple stmt1, stmt2;
+  gimple_call stmt1;
+  gimple_assign stmt2;
   tree tree_uid, cur_func, void0;
 
   if (cgraph_only_called_directly_p (c_node))
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 40f9901..998c06c 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -3349,7 +3349,7 @@ scev_const_prop (void)
   basic_block bb;
   tree name, type, ev;
   gimple_phi phi;
-  gimple ass;
+  gimple_assign ass;
   struct loop *loop, *ex_loop;
   bitmap ssa_names_to_remove = NULL;
   unsigned i;
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 60728aa..52198a8 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1530,7 +1530,7 @@ build_ref_for_offset (location_t loc, tree base, 
HOST_WIDE_INT offset,
      offset such as array[var_index].  */
   if (!base)
     {
-      gimple stmt;
+      gimple_assign stmt;
       tree tmp, addr;
 
       gcc_checking_assert (gsi);
@@ -2612,7 +2612,7 @@ generate_subtree_copies (struct access *access, tree agg,
              || access->offset + access->size > start_offset))
        {
          tree expr, repl = get_access_replacement (access);
-         gimple stmt;
+         gimple_assign stmt;
 
          expr = build_ref_for_model (loc, agg, access->offset - top_offset,
                                      access, gsi, insert_after);
@@ -2650,7 +2650,7 @@ generate_subtree_copies (struct access *access, tree agg,
               && (chunk_size == 0
                   || access->offset + access->size > start_offset))
        {
-         gimple ds;
+         gimple_debug ds;
          tree drhs = build_debug_ref_for_model (loc, agg,
                                                 access->offset - top_offset,
                                                 access);
@@ -2686,7 +2686,7 @@ init_subtree_with_zero (struct access *access, 
gimple_stmt_iterator *gsi,
 
   if (access->grp_to_be_replaced)
     {
-      gimple stmt;
+      gimple_assign stmt;
 
       stmt = gimple_build_assign (get_access_replacement (access),
                                  build_zero_cst (access->type));
@@ -2699,9 +2699,10 @@ init_subtree_with_zero (struct access *access, 
gimple_stmt_iterator *gsi,
     }
   else if (access->grp_to_be_debug_replaced)
     {
-      gimple ds = gimple_build_debug_bind (get_access_replacement (access),
-                                          build_zero_cst (access->type),
-                                          gsi_stmt (*gsi));
+      gimple_debug ds =
+       gimple_build_debug_bind (get_access_replacement (access),
+                                build_zero_cst (access->type),
+                                gsi_stmt (*gsi));
       if (insert_after)
        gsi_insert_after (gsi, ds, GSI_NEW_STMT);
       else
@@ -2788,7 +2789,7 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, 
bool write)
 
          if (write)
            {
-             gimple stmt;
+             gimple_assign stmt;
 
              if (access->grp_partial_lhs)
                ref = force_gimple_operand_gsi (gsi, ref, true, NULL_TREE,
@@ -2799,7 +2800,7 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, 
bool write)
            }
          else
            {
-             gimple stmt;
+             gimple_assign stmt;
 
              if (access->grp_partial_lhs)
                repl = force_gimple_operand_gsi (gsi, repl, true, NULL_TREE,
@@ -2815,9 +2816,10 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, 
bool write)
     }
   else if (write && access->grp_to_be_debug_replaced)
     {
-      gimple ds = gimple_build_debug_bind (get_access_replacement (access),
-                                          NULL_TREE,
-                                          gsi_stmt (*gsi));
+      gimple_debug ds =
+       gimple_build_debug_bind (get_access_replacement (access),
+                                NULL_TREE,
+                                gsi_stmt (*gsi));
       gsi_insert_after (gsi, ds, GSI_NEW_STMT);
     }
 
@@ -2900,7 +2902,7 @@ load_assign_lhs_subreplacements (struct access *lacc, 
struct access *top_racc,
       if (lacc->grp_to_be_replaced)
        {
          struct access *racc;
-         gimple stmt;
+         gimple_assign stmt;
          tree rhs;
 
          racc = find_access_in_subtree (top_racc, offset, lacc->size);
@@ -2947,7 +2949,7 @@ load_assign_lhs_subreplacements (struct access *lacc, 
struct access *top_racc,
                                                              old_gsi);
          if (lacc && lacc->grp_to_be_debug_replaced)
            {
-             gimple ds;
+             gimple_debug ds;
              tree drhs;
              struct access *racc = find_access_in_subtree (top_racc, offset,
                                                            lacc->size);
@@ -3189,7 +3191,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator 
*gsi)
            drhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR,
                                    TREE_TYPE (dlhs), drhs);
        }
-      gimple ds = gimple_build_debug_bind (dlhs, drhs, *stmt);
+      gimple_debug ds = gimple_build_debug_bind (dlhs, drhs, *stmt);
       gsi_insert_before (gsi, ds, GSI_SAME_STMT);
     }
 
@@ -4693,7 +4695,8 @@ sra_ipa_reset_debug_stmts (ipa_parm_adjustment_vec 
adjustments)
     {
       struct ipa_parm_adjustment *adj;
       imm_use_iterator ui;
-      gimple stmt, def_temp;
+      gimple stmt;
+      gimple_debug def_temp;
       tree name, vexpr, copy = NULL_TREE;
       use_operand_p use_p;
 
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index d10f9ba..3f3c27f 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1847,7 +1847,8 @@ static void
 insert_clobber_before_stack_restore (tree saved_val, tree var,
                                     gimple_htab *visited)
 {
-  gimple stmt, clobber_stmt;
+  gimple stmt;
+  gimple_assign clobber_stmt;
   tree clobber;
   imm_use_iterator iter;
   gimple_stmt_iterator i;
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 1f885c6..294fc33 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1121,7 +1121,7 @@ remove_dead_stmt (gimple_stmt_iterator *i, basic_block bb)
          && !DECL_HAS_VALUE_EXPR_P (lhs))
        {
          tree rhs = gimple_assign_rhs1 (stmt);
-         gimple note
+         gimple_debug note
            = gimple_build_debug_bind (lhs, unshare_expr (rhs), stmt);
          gsi_insert_after (i, note, GSI_SAME_STMT);
        }
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index b483289..4ecab6a 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2191,7 +2191,7 @@ record_equivalences_from_stmt (gimple stmt, int 
may_optimize_p)
       && !is_gimple_reg (lhs))
     {
       tree rhs = gimple_assign_rhs1 (stmt);
-      gimple new_stmt;
+      gimple_assign new_stmt;
 
       /* Build a new statement with the RHS and LHS exchanged.  */
       if (TREE_CODE (rhs) == SSA_NAME)
@@ -2423,7 +2423,7 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
          tree lhs = gimple_assign_lhs (stmt);
          tree rhs = gimple_assign_rhs1 (stmt);
          tree cached_lhs;
-         gimple new_stmt;
+         gimple_assign new_stmt;
          if (TREE_CODE (rhs) == SSA_NAME)
            {
              tree tem = SSA_NAME_VALUE (rhs);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 87e44b7..c46d2e4 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1962,7 +1962,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
       && INTEGRAL_TYPE_P (TREE_TYPE (def1_arg1))
       && int_fits_type_p (arg2, TREE_TYPE (def1_arg1)))
     {
-      gimple newop;
+      gimple_assign newop;
       tree tem = make_ssa_name (TREE_TYPE (def1_arg1), NULL);
       newop =
         gimple_build_assign_with_ops (code, tem, def1_arg1,
@@ -1985,7 +1985,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
       && types_compatible_p (TREE_TYPE (def1_arg1), TREE_TYPE (def2_arg1))
       && hoist_conversion_for_bitop_p (TREE_TYPE (arg1), TREE_TYPE 
(def1_arg1)))
     {
-      gimple newop;
+      gimple_assign newop;
       tree tem = make_ssa_name (TREE_TYPE (def1_arg1), NULL);
       newop = gimple_build_assign_with_ops (code, tem, def1_arg1, def2_arg1);
       gimple_set_location (newop, gimple_location (stmt));
@@ -2027,7 +2027,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
        }
       else
        {
-         gimple newop;
+         gimple_assign newop;
          tree tem;
          tem = make_ssa_name (TREE_TYPE (arg2), NULL);
          newop = gimple_build_assign_with_ops (code, tem, a, c);
@@ -2051,7 +2051,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
       tree cst = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg2),
                              arg2, def1_arg2);
       tree tem;
-      gimple newop;
+      gimple_assign newop;
       if (integer_zerop (cst))
        {
          gimple_assign_set_rhs1 (stmt, def1_arg1);
@@ -2259,7 +2259,7 @@ simplify_rotate (gimple_stmt_iterator *gsi)
   tree lhs;
   int i;
   bool swapped_p = false;
-  gimple g;
+  gimple_assign g;
 
   arg[0] = gimple_assign_rhs1 (stmt);
   arg[1] = gimple_assign_rhs2 (stmt);
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index aa51afb..00e6e16 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -862,12 +862,12 @@ nonpure_call_p (gimple stmt)
 static gimple
 rewrite_reciprocal (gimple_stmt_iterator *bsi)
 {
-  gimple stmt, stmt1, stmt2;
+  gimple_assign stmt, stmt1, stmt2;
   tree name, lhs, type;
   tree real_one;
   gimple_stmt_iterator gsi;
 
-  stmt = gsi_stmt (*bsi);
+  stmt = gsi_stmt (*bsi)->as_a_gimple_assign ();
   lhs = gimple_assign_lhs (stmt);
   type = TREE_TYPE (lhs);
 
@@ -897,11 +897,14 @@ rewrite_reciprocal (gimple_stmt_iterator *bsi)
 static gimple
 rewrite_bittest (gimple_stmt_iterator *bsi)
 {
-  gimple stmt, use_stmt, stmt1, stmt2;
+  gimple_assign stmt;
+  gimple stmt1;
+  gimple_assign stmt2;
+  gimple use_stmt;
   tree lhs, name, t, a, b;
   use_operand_p use;
 
-  stmt = gsi_stmt (*bsi);
+  stmt = gsi_stmt (*bsi)->as_a_gimple_assign ();
   lhs = gimple_assign_lhs (stmt);
 
   /* Verify that the single use of lhs is a comparison against zero.  */
@@ -1154,7 +1157,7 @@ move_computations_dom_walker::before_dom_children 
(basic_block bb)
 
   for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); )
     {
-      gimple new_stmt;
+      gimple_assign new_stmt;
       stmt = gsi_stmt (bsi);
 
       lim_data = get_lim_data (stmt);
@@ -1930,7 +1933,7 @@ execute_sm (struct loop *loop, vec<edge> exits, mem_ref_p 
ref)
 {
   tree tmp_var, store_flag = NULL_TREE;
   unsigned i;
-  gimple load;
+  gimple_assign load;
   struct fmt_data fmt_data;
   edge ex;
   struct lim_aux_data *lim_data;
@@ -1987,7 +1990,7 @@ execute_sm (struct loop *loop, vec<edge> exits, mem_ref_p 
ref)
   FOR_EACH_VEC_ELT (exits, i, ex)
     if (!multi_threaded_model_p)
       {
-       gimple store;
+       gimple_assign store;
        store = gimple_build_assign (unshare_expr (ref->mem.ref), tmp_var);
        gsi_insert_on_edge (ex, store);
       }
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index b475b06..6049f81 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -493,7 +493,7 @@ remove_exits_and_undefined_stmts (struct loop *loop, 
unsigned int npeeled)
          && elt->bound.ult (double_int::from_uhwi (npeeled)))
        {
          gimple_stmt_iterator gsi = gsi_for_stmt (elt->stmt);
-         gimple stmt = gimple_build_call
+         gimple_call stmt = gimple_build_call
              (builtin_decl_implicit (BUILT_IN_UNREACHABLE), 0);
 
          gimple_set_location (stmt, gimple_location (elt->stmt));
@@ -612,7 +612,7 @@ unloop_loops (bitmap loop_closed_ssa_invalidated,
       edge latch_edge = loop_latch_edge (loop);
       int flags = latch_edge->flags;
       location_t locus = latch_edge->goto_locus;
-      gimple stmt;
+      gimple_call stmt;
       gimple_stmt_iterator gsi;
 
       remove_exits_and_undefined_stmts (loop, n_unroll);
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 24f296a..eba5b0f 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -6225,7 +6225,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
 {
   tree comp;
   tree op, tgt;
-  gimple ass;
+  gimple_assign ass;
   gimple_stmt_iterator bsi;
 
   /* An important special case -- if we are asked to express value of
@@ -6642,7 +6642,8 @@ remove_unused_ivs (struct ivopts_data *data)
                    DECL_MODE (vexpr) = DECL_MODE (SSA_NAME_VAR (def));
                  else
                    DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (vexpr));
-                 gimple def_temp = gimple_build_debug_bind (vexpr, comp, NULL);
+                 gimple_debug def_temp =
+                   gimple_build_debug_bind (vexpr, comp, NULL);
                  gimple_stmt_iterator gsi;
 
                  if (gimple_code (SSA_NAME_DEF_STMT (def)) == GIMPLE_PHI)
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index dbcc4ce..235b6fc 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -1264,7 +1264,7 @@ rewrite_phi_with_iv (loop_p loop,
                     tree main_iv)
 {
   affine_iv iv;
-  gimple stmt;
+  gimple_assign stmt;
   gimple_phi phi = psi->phi ();
   tree atype, mtype, val, res = PHI_RESULT (phi);
 
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index be34d05..c7d163f 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -1127,7 +1127,7 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned 
unroll_factor, unsigned ahead)
 {
   HOST_WIDE_INT delta;
   tree addr, addr_base, write_p, local, forward;
-  gimple prefetch;
+  gimple_call prefetch;
   gimple_stmt_iterator bsi;
   unsigned n_prefetches, ap;
   bool nontemporal = ref->reuse_distance >= L2_CACHE_SIZE_BYTES;
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index c9e5674..8102768 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -354,7 +354,7 @@ insert_reciprocals (gimple_stmt_iterator *def_gsi, struct 
occurrence *occ,
                    tree def, tree recip_def, int threshold)
 {
   tree type;
-  gimple new_stmt;
+  gimple_assign new_stmt;
   gimple_stmt_iterator gsi;
   struct occurrence *occ_child;
 
@@ -979,7 +979,7 @@ powi_as_mults_1 (gimple_stmt_iterator *gsi, location_t loc, 
tree type,
 {
   tree op0, op1, ssa_target;
   unsigned HOST_WIDE_INT digit;
-  gimple mult_stmt;
+  gimple_assign mult_stmt;
 
   if (n < POWI_TABLE_SIZE && cache[n])
     return cache[n];
@@ -1019,7 +1019,7 @@ powi_as_mults (gimple_stmt_iterator *gsi, location_t loc,
               tree arg0, HOST_WIDE_INT n)
 {
   tree cache[POWI_TABLE_SIZE], result, type = TREE_TYPE (arg0);
-  gimple div_stmt;
+  gimple_assign div_stmt;
   tree target;
 
   if (n == 0)
@@ -1095,7 +1095,7 @@ build_and_insert_binop (gimple_stmt_iterator *gsi, 
location_t loc,
                        tree arg0, tree arg1)
 {
   tree result = make_temp_ssa_name (TREE_TYPE (arg0), NULL, name);
-  gimple stmt = gimple_build_assign_with_ops (code, result, arg0, arg1);
+  gimple_assign stmt = gimple_build_assign_with_ops (code, result, arg0, arg1);
   gimple_set_location (stmt, loc);
   gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
   return result;
@@ -1125,7 +1125,8 @@ build_and_insert_cast (gimple_stmt_iterator *gsi, 
location_t loc,
                       tree type, tree val)
 {
   tree result = make_ssa_name (type, NULL);
-  gimple stmt = gimple_build_assign_with_ops (NOP_EXPR, result, val, 
NULL_TREE);
+  gimple_assign stmt =
+    gimple_build_assign_with_ops (NOP_EXPR, result, val, NULL_TREE);
   gimple_set_location (stmt, loc);
   gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
   return result;
@@ -1468,7 +1469,8 @@ execute_cse_sincos (void)
                  if (result)
                    {
                      tree lhs = gimple_get_lhs (stmt);
-                     gimple new_stmt = gimple_build_assign (lhs, result);
+                     gimple_assign new_stmt =
+                       gimple_build_assign (lhs, result);
                      gimple_set_location (new_stmt, loc);
                      unlink_stmt_vdef (stmt);
                      gsi_replace (&gsi, new_stmt, true);
@@ -1486,7 +1488,7 @@ execute_cse_sincos (void)
                  if (real_minus_onep (arg0))
                    {
                       tree t0, t1, cond, one, minus_one;
-                     gimple stmt;
+                     gimple_assign stmt;
 
                      t0 = TREE_TYPE (arg0);
                      t1 = TREE_TYPE (arg1);
@@ -1520,7 +1522,7 @@ execute_cse_sincos (void)
                  if (result)
                    {
                      tree lhs = gimple_get_lhs (stmt);
-                     gimple new_stmt = gimple_build_assign (lhs, result);
+                     gimple_assign new_stmt = gimple_build_assign (lhs, 
result);
                      gimple_set_location (new_stmt, loc);
                      unlink_stmt_vdef (stmt);
                      gsi_replace (&gsi, new_stmt, true);
@@ -1538,7 +1540,7 @@ execute_cse_sincos (void)
                  if (result)
                    {
                      tree lhs = gimple_get_lhs (stmt);
-                     gimple new_stmt = gimple_build_assign (lhs, result);
+                     gimple_assign new_stmt = gimple_build_assign (lhs, 
result);
                      gimple_set_location (new_stmt, loc);
                      unlink_stmt_vdef (stmt);
                      gsi_replace (&gsi, new_stmt, true);
@@ -2021,7 +2023,7 @@ execute_optimize_bswap (void)
          /* Convert the src expression if necessary.  */
          if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
            {
-             gimple convert_stmt;
+             gimple_assign convert_stmt;
              bswap_tmp = make_temp_ssa_name (bswap_type, NULL, "bswapsrc");
              convert_stmt = gimple_build_assign_with_ops
                                (NOP_EXPR, bswap_tmp, bswap_src, NULL);
@@ -2035,7 +2037,7 @@ execute_optimize_bswap (void)
          /* Convert the result if necessary.  */
          if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
            {
-             gimple convert_stmt;
+             gimple_assign convert_stmt;
              bswap_tmp = make_temp_ssa_name (bswap_type, NULL, "bswapdst");
              convert_stmt = gimple_build_assign_with_ops
                        (NOP_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
@@ -2587,7 +2589,8 @@ convert_mult_to_fma (gimple mul_stmt, tree op1, tree op2)
 {
   tree mul_result = gimple_get_lhs (mul_stmt);
   tree type = TREE_TYPE (mul_result);
-  gimple use_stmt, neguse_stmt, fma_stmt;
+  gimple use_stmt, neguse_stmt;
+  gimple_assign fma_stmt;
   use_operand_p use_p;
   imm_use_iterator imm_iter;
 
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 9828f18..b8ed719 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -593,7 +593,8 @@ conditional_replacement (basic_block cond_bb, basic_block 
middle_bb,
                         tree arg0, tree arg1)
 {
   tree result;
-  gimple stmt, new_stmt;
+  gimple stmt;
+  gimple_assign new_stmt;
   tree cond;
   gimple_stmt_iterator gsi;
   edge true_edge, false_edge;
@@ -1201,7 +1202,8 @@ abs_replacement (basic_block cond_bb, basic_block 
middle_bb,
                 gimple phi, tree arg0, tree arg1)
 {
   tree result;
-  gimple new_stmt, cond;
+  gimple_assign new_stmt;
+  gimple cond;
   gimple_stmt_iterator gsi;
   edge true_edge, false_edge;
   gimple assign;
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index 33ac8c8..73792bb 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -166,7 +166,7 @@ phiprop_insert_phi (basic_block bb, gimple_phi phi, gimple 
use_stmt,
   FOR_EACH_EDGE (e, ei, bb->preds)
     {
       tree old_arg, new_var;
-      gimple tmp;
+      gimple_assign tmp;
       source_location locus;
 
       old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index e7b3ca2..c7d19cd 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -2861,7 +2861,7 @@ create_expression_by_pieces (basic_block block, pre_expr 
expr,
   gimple_stmt_iterator gsi;
   tree exprtype = type ? type : get_expr_type (expr);
   pre_expr nameexpr;
-  gimple newstmt;
+  gimple_assign newstmt;
 
   switch (expr->kind)
     {
@@ -4035,9 +4035,10 @@ eliminate_insert (gimple_stmt_iterator *gsi, tree val)
     return NULL_TREE;
 
   tree res = make_temp_ssa_name (TREE_TYPE (val), NULL, "pretmp");
-  gimple tem = gimple_build_assign (res,
-                                   fold_build1 (TREE_CODE (expr),
-                                                TREE_TYPE (expr), leader));
+  gimple_assign tem =
+    gimple_build_assign (res,
+                        fold_build1 (TREE_CODE (expr),
+                                     TREE_TYPE (expr), leader));
   gsi_insert_before (gsi, tem, GSI_SAME_STMT);
   VN_INFO_GET (res)->valnum = val;
 
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 6965fb2..a2afcdd 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -727,7 +727,7 @@ bool
 update_gimple_call (gimple_stmt_iterator *si_p, tree fn, int nargs, ...)
 {
   va_list ap;
-  gimple new_stmt, stmt = gsi_stmt (*si_p);
+  gimple_call new_stmt, stmt = gsi_stmt (*si_p)->as_a_gimple_call ();
 
   gcc_assert (is_gimple_call (stmt));
   va_start (ap, nargs);
@@ -761,7 +761,7 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree 
expr)
       unsigned i;
       unsigned nargs = call_expr_nargs (expr);
       vec<tree> args = vNULL;
-      gimple new_stmt;
+      gimple_call new_stmt;
 
       if (nargs > 0)
         {
@@ -1086,7 +1086,7 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
          }
        else if (gimple_code (def_stmt) == GIMPLE_PHI)
          {
-           gimple new_stmt = gimple_build_assign (name, val);
+           gimple_assign new_stmt = gimple_build_assign (name, val);
            gimple_stmt_iterator gsi2;
            gsi2 = gsi_after_labels (gimple_bb (def_stmt));
            gsi_insert_before (&gsi2, new_stmt, GSI_SAME_STMT);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index c8421b7..932d82b 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1287,7 +1287,7 @@ build_and_add_sum (tree type, tree op1, tree op2, enum 
tree_code opcode)
   gimple op1def = NULL, op2def = NULL;
   gimple_stmt_iterator gsi;
   tree op;
-  gimple sum;
+  gimple_assign sum;
 
   /* Create the addition statement.  */
   op = make_ssa_name (type, NULL);
@@ -2675,8 +2675,9 @@ update_ops (tree var, enum tree_code code, 
vec<operand_entry_t> ops,
     {
       gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
       var = make_ssa_name (TREE_TYPE (var), NULL);
-      gimple g = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt),
-                                              var, rhs[2], rhs[3]);
+      gimple_assign g =
+       gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt),
+                                     var, rhs[2], rhs[3]);
       gimple_set_uid (g, gimple_uid (stmt));
       gimple_set_visited (g, true);
       gsi_insert_before (&gsi, g, GSI_SAME_STMT);
@@ -2974,7 +2975,7 @@ maybe_optimize_range_tests (gimple stmt)
                      tree new_lhs = make_ssa_name (TREE_TYPE (lhs), NULL);
                      enum tree_code rhs_code
                        = gimple_assign_rhs_code (cast_stmt);
-                     gimple g;
+                     gimple_assign g;
                      if (is_gimple_min_invariant (new_op))
                        {
                          new_op = fold_convert (TREE_TYPE (lhs), new_op);
@@ -3361,7 +3362,7 @@ get_reassociation_width (int ops_num, enum tree_code opc,
    parallel.  */
 
 static void
-rewrite_expr_tree_parallel (gimple stmt, int width,
+rewrite_expr_tree_parallel (gimple_assign stmt, int width,
                            vec<operand_entry_t> ops)
 {
   enum tree_code opcode = gimple_assign_rhs_code (stmt);
@@ -4503,7 +4504,8 @@ reassociate_bb (basic_block bb)
 
                  if (width > 1
                      && ops.length () > 3)
-                   rewrite_expr_tree_parallel (stmt, width, ops);
+                   rewrite_expr_tree_parallel (stmt->as_a_gimple_assign (),
+                                               width, ops);
                  else
                     {
                       /* When there are three operands left, we want
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 7d0e844..bbf042c 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -477,7 +477,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, 
tree var)
        ;
       else
        {
-         gimple def_temp;
+         gimple_debug def_temp;
          tree vexpr = make_node (DEBUG_EXPR_DECL);
 
          def_temp = gimple_build_debug_bind (vexpr,
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index de3045a..e84d0b5 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -321,7 +321,7 @@ emit_case_bit_tests (gimple_switch swtch, tree index_expr,
   unsigned int branch_num = gimple_switch_num_labels (swtch);
 
   gimple_stmt_iterator gsi;
-  gimple shift_stmt;
+  gimple_assign shift_stmt;
 
   tree idx, tmp, csui;
   tree word_type_node = lang_hooks.types.type_for_mode (word_mode, 1);
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index e89f9ba..25644ad 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -633,7 +633,7 @@ adjust_return_value_with_ops (enum tree_code code, const 
char *label,
 
   tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
   tree result = make_temp_ssa_name (ret_type, NULL, label);
-  gimple stmt;
+  gimple_assign stmt;
 
   if (POINTER_TYPE_P (ret_type))
     {
@@ -670,7 +670,7 @@ static tree
 update_accumulator_with_ops (enum tree_code code, tree acc, tree op1,
                             gimple_stmt_iterator gsi)
 {
-  gimple stmt;
+  gimple_assign stmt;
   tree var = copy_ssa_name (acc, NULL);
   if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
     stmt = gimple_build_assign_with_ops (code, var, acc, op1);
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index fe8cd9d..fb4f800 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4282,7 +4282,7 @@ bump_vector_ptr (tree dataref_ptr, gimple ptr_incr, 
gimple_stmt_iterator *gsi,
   struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
   tree vectype = STMT_VINFO_VECTYPE (stmt_info);
   tree update = TYPE_SIZE_UNIT (vectype);
-  gimple incr_stmt;
+  gimple_assign incr_stmt;
   ssa_op_iter iter;
   use_operand_p use_p;
   tree new_dataref_ptr;
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index a166d1e..70428d9 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6791,7 +6791,7 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator 
*gsi,
   /* Handle cond expr.  */
   for (j = 0; j < ncopies; j++)
     {
-      gimple new_stmt = NULL;
+      gimple_assign new_stmt = NULL;
       if (j == 0)
        {
           if (slp_node)
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index a19bbcd..902b879 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -4484,7 +4484,7 @@ static gimple
 build_assert_expr_for (tree cond, tree v)
 {
   tree a;
-  gimple assertion;
+  gimple_assign assertion;
 
   gcc_assert (TREE_CODE (v) == SSA_NAME
              && COMPARISON_CLASS_P (cond));
@@ -8575,7 +8575,8 @@ simplify_truth_ops_using_ranges (gimple_stmt_iterator 
*gsi, gimple stmt)
   else if (need_conversion)
     {
       tree tem = make_ssa_name (TREE_TYPE (op0), NULL);
-      gimple newop = gimple_build_assign_with_ops (BIT_XOR_EXPR, tem, op0, 
op1);
+      gimple_assign newop =
+       gimple_build_assign_with_ops (BIT_XOR_EXPR, tem, op0, op1);
       gsi_insert_before (gsi, newop, GSI_SAME_STMT);
       gimple_assign_set_rhs_with_ops (gsi, NOP_EXPR, tem, NULL_TREE);
     }
@@ -9249,7 +9250,7 @@ simplify_float_conversion_using_ranges 
(gimple_stmt_iterator *gsi, gimple stmt)
   enum machine_mode fltmode = TYPE_MODE (TREE_TYPE (gimple_assign_lhs (stmt)));
   enum machine_mode mode;
   tree tem;
-  gimple conv;
+  gimple_assign conv;
 
   /* We can only handle constant ranges.  */
   if (vr->type != VR_RANGE
diff --git a/gcc/ubsan.c b/gcc/ubsan.c
index ac40c85..7d801da 100644
--- a/gcc/ubsan.c
+++ b/gcc/ubsan.c
@@ -615,7 +615,8 @@ instrument_member_call (gimple_stmt_iterator *iter)
 {
   tree this_parm = gimple_call_arg (gsi_stmt (*iter), 0);
   tree kind = build_int_cst (unsigned_char_type_node, UBSAN_MEMBER_CALL);
-  gimple g = gimple_build_call_internal (IFN_UBSAN_NULL, 2, this_parm, kind);
+  gimple_call g =
+    gimple_build_call_internal (IFN_UBSAN_NULL, 2, this_parm, kind);
   gimple_set_location (g, gimple_location (gsi_stmt (*iter)));
   gsi_insert_before (iter, g, GSI_SAME_STMT);
 }
@@ -630,7 +631,7 @@ instrument_mem_ref (tree t, gimple_stmt_iterator *iter, 
bool is_lhs)
   if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (TREE_TYPE (t))))
     ikind = UBSAN_MEMBER_ACCESS;
   tree kind = build_int_cst (unsigned_char_type_node, ikind);
-  gimple g = gimple_build_call_internal (IFN_UBSAN_NULL, 2, t, kind);
+  gimple_call g = gimple_build_call_internal (IFN_UBSAN_NULL, 2, t, kind);
   gimple_set_location (g, gimple_location (gsi_stmt (*iter)));
   gsi_insert_before (iter, g, GSI_SAME_STMT);
 }
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index eabd84c..055d221 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -125,10 +125,11 @@ along with GCC; see the file COPYING3.  If not see
      and gimple_value_profile_transformations table-driven, perhaps...
 */
 
-static tree gimple_divmod_fixed_value (gimple, tree, int, gcov_type, 
gcov_type);
-static tree gimple_mod_pow2 (gimple, int, gcov_type, gcov_type);
-static tree gimple_mod_subtract (gimple, int, int, int, gcov_type, gcov_type,
-                                gcov_type);
+static tree gimple_divmod_fixed_value (gimple_assign, tree, int, gcov_type,
+                                      gcov_type);
+static tree gimple_mod_pow2 (gimple_assign, int, gcov_type, gcov_type);
+static tree gimple_mod_subtract (gimple_assign, int, int, int, gcov_type,
+                                gcov_type, gcov_type);
 static bool gimple_divmod_fixed_value_transform (gimple_stmt_iterator *);
 static bool gimple_mod_pow2_value_transform (gimple_stmt_iterator *);
 static bool gimple_mod_subtract_transform (gimple_stmt_iterator *);
@@ -705,10 +706,11 @@ gimple_value_profile_transformations (void)
    alter the original STMT.  */
 
 static tree
-gimple_divmod_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
-                          gcov_type all)
+gimple_divmod_fixed_value (gimple_assign stmt, tree value, int prob,
+                          gcov_type count, gcov_type all)
 {
-  gimple stmt1, stmt2, stmt3;
+  gimple_assign stmt1, stmt2;
+  gimple_cond stmt3;
   tree tmp0, tmp1, tmp2;
   gimple bb1end, bb2end, bb3end;
   basic_block bb, bb2, bb3, bb4;
@@ -792,10 +794,10 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator 
*si)
   gcov_type val, count, all;
   tree result, value, tree_val;
   gcov_type prob;
-  gimple stmt;
+  gimple_assign stmt;
 
-  stmt = gsi_stmt (*si);
-  if (gimple_code (stmt) != GIMPLE_ASSIGN)
+  stmt = gsi_stmt (*si)->dyn_cast_gimple_assign ();
+  if (!stmt)
     return false;
 
   if (!INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (stmt))))
@@ -860,9 +862,10 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator 
*si)
    within roundoff error).  This generates the result into a temp and returns
    the temp; it does not replace or alter the original STMT.  */
 static tree
-gimple_mod_pow2 (gimple stmt, int prob, gcov_type count, gcov_type all)
+gimple_mod_pow2 (gimple_assign stmt, int prob, gcov_type count, gcov_type all)
 {
-  gimple stmt1, stmt2, stmt3, stmt4;
+  gimple_assign stmt1, stmt2, stmt3;
+  gimple_cond stmt4;
   tree tmp2, tmp3;
   gimple bb1end, bb2end, bb3end;
   basic_block bb, bb2, bb3, bb4;
@@ -946,10 +949,10 @@ gimple_mod_pow2_value_transform (gimple_stmt_iterator *si)
   gcov_type count, wrong_values, all;
   tree lhs_type, result, value;
   gcov_type prob;
-  gimple stmt;
+  gimple_assign stmt;
 
-  stmt = gsi_stmt (*si);
-  if (gimple_code (stmt) != GIMPLE_ASSIGN)
+  stmt = gsi_stmt (*si)->dyn_cast_gimple_assign ();
+  if (!stmt)
     return false;
 
   lhs_type = TREE_TYPE (gimple_assign_lhs (stmt));
@@ -1012,10 +1015,12 @@ gimple_mod_pow2_value_transform (gimple_stmt_iterator 
*si)
 /* FIXME: Generalize the interface to handle NCOUNTS > 1.  */
 
 static tree
-gimple_mod_subtract (gimple stmt, int prob1, int prob2, int ncounts,
+gimple_mod_subtract (gimple_assign stmt, int prob1, int prob2, int ncounts,
                     gcov_type count1, gcov_type count2, gcov_type all)
 {
-  gimple stmt1, stmt2, stmt3;
+  gimple_assign stmt1;
+  gimple stmt2;
+  gimple_cond stmt3;
   tree tmp1;
   gimple bb1end, bb2end = NULL, bb3end;
   basic_block bb, bb2, bb3, bb4;
@@ -1118,10 +1123,10 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si)
   gcov_type prob1, prob2;
   unsigned int i, steps;
   gcov_type count1, count2;
-  gimple stmt;
+  gimple_assign stmt;
 
-  stmt = gsi_stmt (*si);
-  if (gimple_code (stmt) != GIMPLE_ASSIGN)
+  stmt = gsi_stmt (*si)->dyn_cast_gimple_assign ();
+  if (!stmt)
     return false;
 
   lhs_type = TREE_TYPE (gimple_assign_lhs (stmt));
@@ -1319,7 +1324,9 @@ gimple
 gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
           int prob, gcov_type count, gcov_type all)
 {
-  gimple dcall_stmt, load_stmt, cond_stmt;
+  gimple dcall_stmt;
+  gimple_assign load_stmt;
+  gimple_cond cond_stmt;
   tree tmp0, tmp1, tmp;
   basic_block cond_bb, dcall_bb, icall_bb, join_bb = NULL;
   tree optype = build_pointer_type (void_type_node);
-- 
1.8.5.3

Reply via email to