Use gassign * everywhere that a stmt is built from a
gimple_build_assign_* call, to ease making the gimple_assign_
accessors typesafe (and to better document the code).

gcc/ChangeLog.gimple-classes:
        * asan.c (build_shadow_mem_access): Strengthen local "g" from
        gimple to gassign *.
        (maybe_create_ssa_name): Likewise.
        (maybe_cast_to_ptrmode): Likewise.
        (instrument_mem_region_access): Likewise.
        * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Likewise
        for local "set_stmt".
        * cgraphunit.c (cgraph_node::expand_thunk): Likewise for locals
        "stmt".
        * gimple-fold.c (gimplify_and_update_call_from_tree): Likewise for
        local "new_stmt".
        (gimple_fold_builtin_memory_op): Likewise for both "new_stmt" and
        for locals "repl".
        (gimple_fold_builtin_memset): Likewise for "store".
        (gimple_fold_builtin_memset): Likewise for "asgn".
        * gimple-match-head.c (maybe_push_res_to_seq): Likewise for
        "new_stmt".
        * gimplify.c (gimplify_bind_expr): Likewise for "clobber_stmt".
        * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence):
        Likewise for "name_stmt".
        * ipa-prop.c (ipa_modify_call_arguments): Likewise. for "tem".
        * ipa-split.c (split_function): Likewise for "cpy".
        * predict.c (pass_strip_predict_hints::execute): Likewise for
        "ass_stmt".
        * trans-mem.c (tm_log_emit_saves): Likewise for "stmt".
        (tm_log_emit_restores): Likewise.
        (build_tm_load): Likewise for "g".
        (build_tm_store): Likewise.
        * tree-call-cdce.c (gen_conditions_for_pow_int_base): Likewise for
        "stmt1".  Strengthen local "stmt2" from gimple to gcond *.
        * tree-cfg.c (make_blocks): Strengthen local "s" from gimple to
        gassign *.
        (handle_abnormal_edges): Likewise for "assignment".
        * tree-emutls.c (lower_emutls_1): Likewise for "x".
        * tree-if-conv.c (ifc_temp_var): Likewise for "stmt".
        (convert_scalar_cond_reduction): Likewise for "new_assign".
        (predicate_scalar_phi): Likewise for "new_stmt".
        * tree-inline.c (remap_ssa_name): Likewise for "init_stmt".
        (copy_bb): Likewise for "new_stmt".
        (setup_one_parameter): Likewise for "init_stmt".
        * tree-loop-distribution.c (generate_memset_builtin): Likewise for
        "cstmt".
        * tree-nested.c (init_tmp_var): Likewise for "stmt".
        (save_tmp_var): Likewise.
        * tree-parloops.c (create_loads_for_reductions): Likewise.
        (create_final_loads_for_reduction): Likewise.
        (create_stores_for_reduction): Likewise.
        (create_loads_and_stores_for_name): Likewise.
        * tree-ssa-dse.c (dse_optimize_stmt): Likewise for "new_stmt".
        * tree-ssa-forwprop.c (associate_pointerplus): Likewise for
        "ostmt".
        * tree-ssa-loop-im.c (sm_set_flag_if_changed::operator): Likewise
        for "stmt".
        * tree-ssa-math-opts.c (execute_cse_sincos_1): Eliminate local
        "stmt", splitting its users into new local gcall * "call_stmt"
        and gassign * "assign_stmt".
        (build_and_insert_ref): Strengthen local "stmt" from gimple to
        gassign *.
        (bswap_replace): Likewise for "load_stmt", "addr_stmt",
        "convert_stmt".
        * tree-ssa-phiopt.c (neg_replacement): Likewise for "new_stmt".
        * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
        Likewise for "stmt".
        * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise
        for "g".
        * tree-ssa-strlen.c (get_string_length): ELiminate local
        "lenstmt", splitting its users into new local gcall * "call_stmt"
        and gassign * "assign_stmt".
        (handle_builtin_memset): Strengthen local "assign" from gimple to
        gassign *.
        * tree-switch-conversion.c (build_one_array): Likewise for "load".
        (build_arrays): Likewise for "stmt".
        * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise for
        "vec_stmt".
        (vect_permute_store_chain): Likewise for "perm_stmt".
        (vect_permute_load_chain): Likewise.
        (vect_shift_permute_load_chain): Likewise.
        * tree-vect-generic.c (expand_vector_divmod): Likewise for "stmt".
        (vector_element): Likewise for "asgn".
        * tree-vect-loop-manip.c (vect_create_cond_for_align_checks):
        Likewise for "and_stmt".
        (vect_create_cond_for_align_checks): Likewise for "addr_stmt" and
        "or_stmt".
        * tree-vect-loop.c (vect_is_simple_reduction_1): Likewise for
        "negate_stmt".
        (get_initial_def_for_induction): Likewise for "init_stmt" and
        "new_stmt".
        (vectorizable_reduction): Likewise for "new_stmt".
        * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Likewise for
        "pattern_stmt".
        (vect_recog_sad_pattern): Likewise.
        (vect_recog_widen_mult_pattern): Likewise for "new_stmt",
        "pattern_stmt".
        (vect_recog_widen_sum_pattern): Likewise for "pattern_stmt".
        (vect_recog_over_widening_pattern): Likewise.
        (vect_recog_widen_shift_pattern): Likewise.
        * tree-vect-slp.c (vect_get_constant_vectors): Likewise for
        "init_stmt".
        (vect_create_mask_and_perm): Likewise for "perm_stmt".
        (vect_schedule_slp_instance): Likewise for "new_stmt".
        * tree-vect-stmts.c (read_vector_array): Likewise.
        (write_vector_array): Likewise.
        (vect_init_vector): Likewise for "init_stmt".
        (vectorizable_call): Likewise.
        * tree-vrp.c (simplify_internal_call_using_ranges): Likewise for
        "g".
        * tsan.c (instrument_expr): Split local gimple "g" into more
        tightly-scoped locals, two of type gassign *, one of gcall *.
---
 gcc/ChangeLog.gimple-classes | 111 +++++++++++++++++++++++++++++++++++++++++++
 gcc/asan.c                   |   8 ++--
 gcc/cgraph.c                 |   2 +-
 gcc/cgraphunit.c             |   4 +-
 gcc/gimple-fold.c            |  13 ++---
 gcc/gimple-match-head.c      |   4 +-
 gcc/gimplify.c               |   2 +-
 gcc/graphite-sese-to-poly.c  |   2 +-
 gcc/ipa-prop.c               |   2 +-
 gcc/ipa-split.c              |   2 +-
 gcc/predict.c                |   2 +-
 gcc/trans-mem.c              |   8 ++--
 gcc/tree-call-cdce.c         |   3 +-
 gcc/tree-cfg.c               |   4 +-
 gcc/tree-emutls.c            |   2 +-
 gcc/tree-if-conv.c           |   6 +--
 gcc/tree-inline.c            |   6 +--
 gcc/tree-loop-distribution.c |   2 +-
 gcc/tree-nested.c            |   4 +-
 gcc/tree-parloops.c          |   8 ++--
 gcc/tree-ssa-dse.c           |   2 +-
 gcc/tree-ssa-forwprop.c      |   2 +-
 gcc/tree-ssa-loop-im.c       |   2 +-
 gcc/tree-ssa-math-opts.c     |  31 ++++++------
 gcc/tree-ssa-phiopt.c        |   3 +-
 gcc/tree-ssa-pre.c           |   2 +-
 gcc/tree-ssa-reassoc.c       |   2 +-
 gcc/tree-ssa-strlen.c        |  22 +++++----
 gcc/tree-switch-conversion.c |   4 +-
 gcc/tree-vect-data-refs.c    |   8 ++--
 gcc/tree-vect-generic.c      |   4 +-
 gcc/tree-vect-loop-manip.c   |   4 +-
 gcc/tree-vect-loop.c         |   8 ++--
 gcc/tree-vect-patterns.c     |  15 +++---
 gcc/tree-vect-slp.c          |   7 +--
 gcc/tree-vect-stmts.c        |   8 ++--
 gcc/tree-vrp.c               |   4 +-
 gcc/tsan.c                   |  10 ++--
 38 files changed, 228 insertions(+), 105 deletions(-)

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 7d9dfb3..9998737 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,3 +1,114 @@
+2014-10-30  David Malcolm  <dmalc...@redhat.com>
+
+       * asan.c (build_shadow_mem_access): Strengthen local "g" from
+       gimple to gassign *.
+       (maybe_create_ssa_name): Likewise.
+       (maybe_cast_to_ptrmode): Likewise.
+       (instrument_mem_region_access): Likewise.
+       * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Likewise
+       for local "set_stmt".
+       * cgraphunit.c (cgraph_node::expand_thunk): Likewise for locals
+       "stmt".
+       * gimple-fold.c (gimplify_and_update_call_from_tree): Likewise for
+       local "new_stmt".
+       (gimple_fold_builtin_memory_op): Likewise for both "new_stmt" and
+       for locals "repl".
+       (gimple_fold_builtin_memset): Likewise for "store".
+       (gimple_fold_builtin_memset): Likewise for "asgn".
+       * gimple-match-head.c (maybe_push_res_to_seq): Likewise for
+       "new_stmt".
+       * gimplify.c (gimplify_bind_expr): Likewise for "clobber_stmt".
+       * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence):
+       Likewise for "name_stmt".
+       * ipa-prop.c (ipa_modify_call_arguments): Likewise. for "tem".
+       * ipa-split.c (split_function): Likewise for "cpy".
+       * predict.c (pass_strip_predict_hints::execute): Likewise for
+       "ass_stmt".
+       * trans-mem.c (tm_log_emit_saves): Likewise for "stmt".
+       (tm_log_emit_restores): Likewise.
+       (build_tm_load): Likewise for "g".
+       (build_tm_store): Likewise.
+       * tree-call-cdce.c (gen_conditions_for_pow_int_base): Likewise for
+       "stmt1".  Strengthen local "stmt2" from gimple to gcond *.
+       * tree-cfg.c (make_blocks): Strengthen local "s" from gimple to
+       gassign *.
+       (handle_abnormal_edges): Likewise for "assignment".
+       * tree-emutls.c (lower_emutls_1): Likewise for "x".
+       * tree-if-conv.c (ifc_temp_var): Likewise for "stmt".
+       (convert_scalar_cond_reduction): Likewise for "new_assign".
+       (predicate_scalar_phi): Likewise for "new_stmt".
+       * tree-inline.c (remap_ssa_name): Likewise for "init_stmt".
+       (copy_bb): Likewise for "new_stmt".
+       (setup_one_parameter): Likewise for "init_stmt".
+       * tree-loop-distribution.c (generate_memset_builtin): Likewise for
+       "cstmt".
+       * tree-nested.c (init_tmp_var): Likewise for "stmt".
+       (save_tmp_var): Likewise.
+       * tree-parloops.c (create_loads_for_reductions): Likewise.
+       (create_final_loads_for_reduction): Likewise.
+       (create_stores_for_reduction): Likewise.
+       (create_loads_and_stores_for_name): Likewise.
+       * tree-ssa-dse.c (dse_optimize_stmt): Likewise for "new_stmt".
+       * tree-ssa-forwprop.c (associate_pointerplus): Likewise for
+       "ostmt".
+       * tree-ssa-loop-im.c (sm_set_flag_if_changed::operator): Likewise
+       for "stmt".
+       * tree-ssa-math-opts.c (execute_cse_sincos_1): Eliminate local
+       "stmt", splitting its users into new local gcall * "call_stmt"
+       and gassign * "assign_stmt".
+       (build_and_insert_ref): Strengthen local "stmt" from gimple to
+       gassign *.
+       (bswap_replace): Likewise for "load_stmt", "addr_stmt",
+       "convert_stmt".
+       * tree-ssa-phiopt.c (neg_replacement): Likewise for "new_stmt".
+       * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
+       Likewise for "stmt".
+       * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise
+       for "g".
+       * tree-ssa-strlen.c (get_string_length): ELiminate local
+       "lenstmt", splitting its users into new local gcall * "call_stmt"
+       and gassign * "assign_stmt".
+       (handle_builtin_memset): Strengthen local "assign" from gimple to
+       gassign *.
+       * tree-switch-conversion.c (build_one_array): Likewise for "load".
+       (build_arrays): Likewise for "stmt".
+       * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise for
+       "vec_stmt".
+       (vect_permute_store_chain): Likewise for "perm_stmt".
+       (vect_permute_load_chain): Likewise.
+       (vect_shift_permute_load_chain): Likewise.
+       * tree-vect-generic.c (expand_vector_divmod): Likewise for "stmt".
+       (vector_element): Likewise for "asgn".
+       * tree-vect-loop-manip.c (vect_create_cond_for_align_checks):
+       Likewise for "and_stmt".
+       (vect_create_cond_for_align_checks): Likewise for "addr_stmt" and
+       "or_stmt".
+       * tree-vect-loop.c (vect_is_simple_reduction_1): Likewise for
+       "negate_stmt".
+       (get_initial_def_for_induction): Likewise for "init_stmt" and
+       "new_stmt".
+       (vectorizable_reduction): Likewise for "new_stmt".
+       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Likewise for
+       "pattern_stmt".
+       (vect_recog_sad_pattern): Likewise.
+       (vect_recog_widen_mult_pattern): Likewise for "new_stmt",
+       "pattern_stmt".
+       (vect_recog_widen_sum_pattern): Likewise for "pattern_stmt".
+       (vect_recog_over_widening_pattern): Likewise.
+       (vect_recog_widen_shift_pattern): Likewise.
+       * tree-vect-slp.c (vect_get_constant_vectors): Likewise for
+       "init_stmt".
+       (vect_create_mask_and_perm): Likewise for "perm_stmt".
+       (vect_schedule_slp_instance): Likewise for "new_stmt".
+       * tree-vect-stmts.c (read_vector_array): Likewise.
+       (write_vector_array): Likewise.
+       (vect_init_vector): Likewise for "init_stmt".
+       (vectorizable_call): Likewise.
+       * tree-vrp.c (simplify_internal_call_using_ranges): Likewise for
+       "g".
+       * tsan.c (instrument_expr): Split local gimple "g" into more
+       tightly-scoped locals, two of type gassign *, one of gcall *.
+
 2014-10-29  David Malcolm  <dmalc...@redhat.com>
 
        * coretypes.h (struct gpredict): Add forward declaration.
diff --git a/gcc/asan.c b/gcc/asan.c
index 9a310b4..68b4676 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -1523,7 +1523,7 @@ build_shadow_mem_access (gimple_stmt_iterator *gsi, 
location_t location,
 {
   tree t, uintptr_type = TREE_TYPE (base_addr);
   tree shadow_type = TREE_TYPE (shadow_ptr_type);
-  gimple g;
+  gassign *g;
 
   t = build_int_cst (uintptr_type, ASAN_SHADOW_SHIFT);
   g = gimple_build_assign_with_ops (RSHIFT_EXPR,
@@ -1564,7 +1564,7 @@ maybe_create_ssa_name (location_t loc, tree base, 
gimple_stmt_iterator *iter,
 {
   if (TREE_CODE (base) == SSA_NAME)
     return base;
-  gimple g
+  gassign *g
     = gimple_build_assign_with_ops (TREE_CODE (base),
                                    make_ssa_name (TREE_TYPE (base), NULL),
                                    base, NULL_TREE);
@@ -1585,7 +1585,7 @@ maybe_cast_to_ptrmode (location_t loc, tree len, 
gimple_stmt_iterator *iter,
 {
   if (ptrofftype_p (len))
     return len;
-  gimple g
+  gassign *g
     = gimple_build_assign_with_ops (NOP_EXPR,
                                    make_ssa_name (pointer_sized_int_node, 
NULL),
                                    len, NULL);
@@ -1854,7 +1854,7 @@ instrument_mem_region_access (tree base, tree len,
 static bool
 instrument_strlen_call (gimple_stmt_iterator *iter)
 {
-  gimple g;
+  gassign *g;
   gcall *call = as_a <gcall *> (gsi_stmt (*iter));
   gcc_assert (is_gimple_call (call));
 
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index e480f73..e123c2c 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1410,7 +1410,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
                                        TREE_TYPE (lhs), NULL);
          var = get_or_create_ssa_default_def
                  (DECL_STRUCT_FUNCTION (e->caller->decl), var);
-         gimple set_stmt = gimple_build_assign (lhs, var);
+         gassign *set_stmt = gimple_build_assign (lhs, var);
           gsi = gsi_for_stmt (new_stmt);
          gsi_insert_before_without_update (&gsi, set_stmt, GSI_SAME_STMT);
          update_stmt_fn (DECL_STRUCT_FUNCTION (e->caller->decl), set_stmt);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index f4f3f42..fb8714b 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1569,7 +1569,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool 
force_gimple_thunk)
              {
                tmp = create_tmp_reg (TYPE_MAIN_VARIANT
                                      (TREE_TYPE (arg)), "arg");
-               gimple stmt = gimple_build_assign (tmp, arg);
+               gassign *stmt = gimple_build_assign (tmp, arg);
                gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
              }
            vargs.quick_push (tmp);
@@ -1622,7 +1622,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool 
force_gimple_thunk)
                                     fixed_offset, virtual_offset);
              if (true_label)
                {
-                 gimple stmt;
+                 gassign *stmt;
                  bsi = gsi_last_bb (else_bb);
                  stmt = gimple_build_assign (restmp,
                                              build_zero_cst (TREE_TYPE 
(restmp)));
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 4b45648..60a272f 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -665,7 +665,8 @@ void
 gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
 {
   tree lhs;
-  gimple stmt, new_stmt;
+  gimple stmt;
+  gassign *new_stmt;
   gimple_stmt_iterator i;
   gimple_seq stmts = NULL;
 
@@ -865,7 +866,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
                    srcmem = NULL_TREE;
                  if (srcmem)
                    {
-                     gimple new_stmt;
+                     gassign *new_stmt;
                      if (is_gimple_reg_type (TREE_TYPE (srcmem)))
                        {
                          new_stmt = gimple_build_assign (NULL_TREE, srcmem);
@@ -1152,7 +1153,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
            }
        }
 
-      gimple new_stmt;
+      gassign *new_stmt;
       if (is_gimple_reg_type (TREE_TYPE (srcvar)))
        {
          new_stmt = gimple_build_assign (NULL_TREE, srcvar);
@@ -1189,7 +1190,7 @@ done:
 
   dest = force_gimple_operand_gsi (gsi, dest, false, NULL_TREE, true,
                                   GSI_SAME_STMT);
-  gimple repl = gimple_build_assign (lhs, dest);
+  gassign *repl = gimple_build_assign (lhs, dest);
   gsi_replace (gsi, repl, true);
   return true;
 }
@@ -1260,7 +1261,7 @@ gimple_fold_builtin_memset (gimple_stmt_iterator *gsi, 
tree c, tree len)
     }
 
   var = fold_build2 (MEM_REF, etype, dest, build_int_cst (ptr_type_node, 0));
-  gimple store = gimple_build_assign (var, build_int_cst_type (etype, cval));
+  gassign *store = gimple_build_assign (var, build_int_cst_type (etype, cval));
   gimple_set_vuse (store, gimple_vuse (stmt));
   tree vdef = gimple_vdef (stmt);
   if (vdef && TREE_CODE (vdef) == SSA_NAME)
@@ -1271,7 +1272,7 @@ gimple_fold_builtin_memset (gimple_stmt_iterator *gsi, 
tree c, tree len)
   gsi_insert_before (gsi, store, GSI_SAME_STMT);
   if (gimple_call_lhs (stmt))
     {
-      gimple asgn = gimple_build_assign (gimple_call_lhs (stmt), dest);
+      gassign *asgn = gimple_build_assign (gimple_call_lhs (stmt), dest);
       gsi_replace (gsi, asgn, true);
     }
   else
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
index 9c6da59..520e523 100644
--- a/gcc/gimple-match-head.c
+++ b/gcc/gimple-match-head.c
@@ -333,8 +333,8 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree 
*ops,
       if (!res)
        res = make_ssa_name (type, NULL);
       maybe_build_generic_op (rcode, type, &ops[0], ops[1], ops[2]);
-      gimple new_stmt = gimple_build_assign_with_ops (rcode, res,
-                                                     ops[0], ops[1], ops[2]);
+      gassign *new_stmt = gimple_build_assign_with_ops (rcode, res,
+                                                       ops[0], ops[1], ops[2]);
       gimple_seq_add_stmt_without_update (seq, new_stmt);
       return res;
     }
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 36367fe..1ce5fa1 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1151,7 +1151,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
          && flag_stack_reuse != SR_NONE)
        {
          tree clobber = build_constructor (TREE_TYPE (t), NULL);
-         gimple clobber_stmt;
+         gassign *clobber_stmt;
          TREE_THIS_VOLATILE (clobber) = 1;
          clobber_stmt = gimple_build_assign (t, clobber);
          gimple_set_location (clobber_stmt, end_locus);
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 16d1bb6..c994fa6 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2345,7 +2345,7 @@ static void
 rewrite_cross_bb_scalar_dependence (scop_p scop, tree zero_dim_array,
                                    tree def, gimple use_stmt)
 {
-  gimple name_stmt;
+  gassign *name_stmt;
   tree name;
   ssa_op_iter iter;
   use_operand_p use_p;
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 47a8f03..6495e2b 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -4300,7 +4300,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gcall 
*stmt,
                 a load into a temporary.  */
              if (is_gimple_reg_type (TREE_TYPE (expr)))
                {
-                 gimple tem = gimple_build_assign (NULL_TREE, expr);
+                 gassign *tem = gimple_build_assign (NULL_TREE, expr);
                  if (gimple_in_ssa_p (cfun))
                    {
                      gimple_set_vuse (tem, gimple_vuse (stmt));
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 145aceb..ed5c1a7 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1492,7 +1492,7 @@ split_function (struct split_point *split_point)
                  gsi_insert_after (&gsi, call, GSI_NEW_STMT);
                  if (!useless_type_conversion_p (TREE_TYPE (retval), restype))
                    {
-                     gimple cpy;
+                     gassign *cpy;
                      tree tem = create_tmp_reg (restype, NULL);
                      tem = make_ssa_name (tem, call);
                      cpy = gimple_build_assign_with_ops (NOP_EXPR, retval,
diff --git a/gcc/predict.c b/gcc/predict.c
index fad0f10..ed8f352 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -3123,7 +3123,7 @@ unsigned int
 pass_strip_predict_hints::execute (function *fun)
 {
   basic_block bb;
-  gimple ass_stmt;
+  gassign *ass_stmt;
   tree var;
 
   FOR_EACH_BB_FN (bb, fun)
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index eb1f5be..7e82de5 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -1281,7 +1281,7 @@ tm_log_emit_saves (basic_block entry_block, basic_block 
bb)
 {
   size_t i;
   gimple_stmt_iterator gsi = gsi_last_bb (bb);
-  gimple stmt;
+  gassign *stmt;
   struct tm_log_entry l, *lp;
 
   for (i = 0; i < tm_log_save_addresses.length (); ++i)
@@ -1318,7 +1318,7 @@ tm_log_emit_restores (basic_block entry_block, 
basic_block bb)
   int i;
   struct tm_log_entry l, *lp;
   gimple_stmt_iterator gsi;
-  gimple stmt;
+  gassign *stmt;
 
   for (i = tm_log_save_addresses.length () - 1; i >= 0; i--)
     {
@@ -2169,7 +2169,7 @@ build_tm_load (location_t loc, tree lhs, tree rhs, 
gimple_stmt_iterator *gsi)
     }
   else
     {
-      gimple g;
+      gassign *g;
       tree temp;
 
       temp = create_tmp_reg (t, NULL);
@@ -2247,7 +2247,7 @@ build_tm_store (location_t loc, tree lhs, tree rhs, 
gimple_stmt_iterator *gsi)
     }
   else if (!useless_type_conversion_p (simple_type, type))
     {
-      gimple g;
+      gassign *g;
       tree temp;
 
       temp = create_tmp_reg (simple_type, NULL);
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 23c2df5..86b3df9 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -468,7 +468,8 @@ gen_conditions_for_pow_int_base (tree base, tree expn,
   tree int_type;
   tree temp, tempn;
   tree cst0;
-  gimple stmt1, stmt2;
+  gassign *stmt1;
+  gcond *stmt2;
   int bit_sz, max_exp;
   inp_domain exp_domain;
 
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index b0df8b6..1d1aaef 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -527,7 +527,7 @@ make_blocks (gimple_seq seq)
            {
              tree lhs = gimple_get_lhs (stmt);
              tree tmp = create_tmp_var (TREE_TYPE (lhs), NULL);
-             gimple s = gimple_build_assign (lhs, tmp);
+             gassign *s = gimple_build_assign (lhs, tmp);
              gimple_set_location (s, gimple_location (stmt));
              gimple_set_block (s, gimple_block (stmt));
              gimple_set_lhs (stmt, tmp);
@@ -739,7 +739,7 @@ handle_abnormal_edges (basic_block *dispatcher_bbs,
              gcc_assert (computed_goto_p (last));
 
              /* Copy the original computed goto's destination into VAR.  */
-             gimple assignment
+             gassign *assignment
                = gimple_build_assign (var, gimple_goto_dest (last));
              gsi_insert_before (&gsi, assignment, GSI_SAME_STMT);
 
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index f456b4b..ec3ea61 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -489,7 +489,7 @@ lower_emutls_1 (tree *ptr, int *walk_subtrees, void 
*cb_data)
             new assignment statement, and substitute yet another SSA_NAME.  */
          if (wi->changed)
            {
-             gimple x;
+             gassign *x;
 
              addr = create_tmp_var (TREE_TYPE (t), NULL);
              x = gimple_build_assign (addr, t);
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index f0beb31..62b1632 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -261,7 +261,7 @@ static tree
 ifc_temp_var (tree type, tree expr, gimple_stmt_iterator *gsi)
 {
   tree new_name = make_temp_ssa_name (type, NULL, "_ifc_");
-  gimple stmt = gimple_build_assign (new_name, expr);
+  gassign *stmt = gimple_build_assign (new_name, expr);
   gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
   return new_name;
 }
@@ -1523,7 +1523,7 @@ convert_scalar_cond_reduction (gimple reduc, 
gimple_stmt_iterator *gsi,
                               tree cond, tree op0, tree op1, bool swap)
 {
   gimple_stmt_iterator stmt_it;
-  gimple new_assign;
+  gassign *new_assign;
   tree rhs;
   tree rhs1 = gimple_assign_rhs1 (reduc);
   tree tmp = make_temp_ssa_name (TREE_TYPE (rhs1), NULL, "_ifc_");
@@ -1575,7 +1575,7 @@ predicate_scalar_phi (gphi *phi, tree cond,
                      basic_block true_bb,
                      gimple_stmt_iterator *gsi)
 {
-  gimple new_stmt;
+  gassign *new_stmt;
   basic_block bb;
   tree rhs, res, arg, scev;
 
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 9cd25c6..53b5d35 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -319,7 +319,7 @@ remap_ssa_name (tree name, copy_body_data *id)
                  || EDGE_COUNT (id->entry_bb->preds) != 1))
            {
              gimple_stmt_iterator gsi = gsi_last_bb (id->entry_bb);
-             gimple init_stmt;
+             gassign *init_stmt;
              tree zero = build_zero_cst (TREE_TYPE (new_tree));
 
              init_stmt = gimple_build_assign (new_tree, zero);
@@ -1827,7 +1827,7 @@ copy_bb (copy_body_data *id, basic_block bb, int 
frequency_scale,
                 the number of anonymous arguments.  */
              size_t nargs = gimple_call_num_args (id->call_stmt);
              tree count, p;
-             gimple new_stmt;
+             gassign *new_stmt;
 
              for (p = DECL_ARGUMENTS (id->src_fn); p; p = DECL_CHAIN (p))
                nargs--;
@@ -2951,7 +2951,7 @@ static gimple
 setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
                     basic_block bb, tree *vars)
 {
-  gimple init_stmt = NULL;
+  gassign *init_stmt = NULL;
   tree var;
   tree rhs = value;
   tree def = (gimple_in_ssa_p (cfun)
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 31ea04c..f0bac46 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -822,7 +822,7 @@ generate_memset_builtin (struct loop *loop, partition_t 
partition)
     val = fold_convert (integer_type_node, val);
   else if (!useless_type_conversion_p (integer_type_node, TREE_TYPE (val)))
     {
-      gimple cstmt;
+      gassign *cstmt;
       tree tem = make_ssa_name (integer_type_node, NULL);
       cstmt = gimple_build_assign_with_ops (NOP_EXPR, tem, val, NULL_TREE);
       gsi_insert_after (&gsi, cstmt, GSI_CONTINUE_LINKING);
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 57acc50..50d7873 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -436,7 +436,7 @@ static tree
 init_tmp_var (struct nesting_info *info, tree exp, gimple_stmt_iterator *gsi)
 {
   tree t;
-  gimple stmt;
+  gassign *stmt;
 
   t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
   stmt = gimple_build_assign (t, exp);
@@ -467,7 +467,7 @@ static tree
 save_tmp_var (struct nesting_info *info, tree exp, gimple_stmt_iterator *gsi)
 {
   tree t;
-  gimple stmt;
+  gassign *stmt;
 
   t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
   stmt = gimple_build_assign (exp, t);
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index a1e0778..785bdec 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -1152,7 +1152,7 @@ int
 create_loads_for_reductions (reduction_info **slot, struct clsn_data 
*clsn_data)
 {
   struct reduction_info *const red = *slot;
-  gimple stmt;
+  gassign *stmt;
   gimple_stmt_iterator gsi;
   tree type = TREE_TYPE (gimple_assign_lhs (red->reduc_stmt));
   tree load_struct;
@@ -1189,7 +1189,7 @@ create_final_loads_for_reduction 
(reduction_info_table_type *reduction_list,
 {
   gimple_stmt_iterator gsi;
   tree t;
-  gimple stmt;
+  gassign *stmt;
 
   gsi = gsi_after_labels (ld_st_data->load_bb);
   t = build_fold_addr_expr (ld_st_data->store);
@@ -1213,7 +1213,7 @@ create_stores_for_reduction (reduction_info **slot, 
struct clsn_data *clsn_data)
 {
   struct reduction_info *const red = *slot;
   tree t;
-  gimple stmt;
+  gassign *stmt;
   gimple_stmt_iterator gsi;
   tree type = TREE_TYPE (gimple_assign_lhs (red->reduc_stmt));
 
@@ -1235,7 +1235,7 @@ create_loads_and_stores_for_name (name_to_copy_elt **slot,
 {
   struct name_to_copy_elt *const elt = *slot;
   tree t;
-  gimple stmt;
+  gassign *stmt;
   gimple_stmt_iterator gsi;
   tree type = TREE_TYPE (elt->new_name);
   tree load_struct;
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 91017ff..3434a80 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -266,7 +266,7 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi)
              tree lhs = gimple_call_lhs (stmt);
              if (lhs)
                {
-                 gimple new_stmt = gimple_build_assign (lhs, ptr);
+                 gassign *new_stmt = gimple_build_assign (lhs, ptr);
                  unlink_stmt_vdef (stmt);
                  if (gsi_replace (gsi, new_stmt, true))
                    bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 55de465..1f4c9de 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -2968,7 +2968,7 @@ associate_pointerplus (gimple_stmt_iterator *gsi)
     return false;
 
   tree off = make_ssa_name (TREE_TYPE (off1), NULL);
-  gimple ostmt = gimple_build_assign_with_ops (PLUS_EXPR, off, off1, off2);
+  gassign *ostmt = gimple_build_assign_with_ops (PLUS_EXPR, off, off1, off2);
   gsi_insert_before (gsi, ostmt, GSI_SAME_STMT);
 
   gimple_assign_set_rhs_with_ops (gsi, POINTER_PLUS_EXPR, ptr, off);
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 6f64f4a..cb0ce4b 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -1928,7 +1928,7 @@ sm_set_flag_if_changed::operator () (mem_ref_loc_p loc)
       && gimple_assign_lhs_ptr (loc->stmt) == loc->ref)
     {
       gimple_stmt_iterator gsi = gsi_for_stmt (loc->stmt);
-      gimple stmt = gimple_build_assign (flag, boolean_true_node);
+      gassign *stmt = gimple_build_assign (flag, boolean_true_node);
       gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
     }
   return false;
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 5211b89..b408b9f 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -737,7 +737,8 @@ execute_cse_sincos_1 (tree name)
   gimple_stmt_iterator gsi;
   imm_use_iterator use_iter;
   tree fndecl, res, type;
-  gimple def_stmt, use_stmt, stmt;
+  gimple def_stmt, use_stmt;
+  gcall *call_stmt;
   int seen_cos = 0, seen_sin = 0, seen_cexpi = 0;
   vec<gimple> stmts = vNULL;
   basic_block top_bb = NULL;
@@ -782,9 +783,10 @@ execute_cse_sincos_1 (tree name)
   fndecl = mathfn_built_in (type, BUILT_IN_CEXPI);
   if (!fndecl)
     return false;
-  stmt = gimple_build_call (fndecl, 1, name);
-  res = make_temp_ssa_name (TREE_TYPE (TREE_TYPE (fndecl)), stmt, "sincostmp");
-  gimple_call_set_lhs (stmt, res);
+  call_stmt = gimple_build_call (fndecl, 1, name);
+  res = make_temp_ssa_name (TREE_TYPE (TREE_TYPE (fndecl)), call_stmt,
+                           "sincostmp");
+  gimple_call_set_lhs (call_stmt, res);
 
   def_stmt = SSA_NAME_DEF_STMT (name);
   if (!SSA_NAME_IS_DEFAULT_DEF (name)
@@ -792,12 +794,12 @@ execute_cse_sincos_1 (tree name)
       && gimple_bb (def_stmt) == top_bb)
     {
       gsi = gsi_for_stmt (def_stmt);
-      gsi_insert_after (&gsi, stmt, GSI_SAME_STMT);
+      gsi_insert_after (&gsi, call_stmt, GSI_SAME_STMT);
     }
   else
     {
       gsi = gsi_after_labels (top_bb);
-      gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
+      gsi_insert_before (&gsi, call_stmt, GSI_SAME_STMT);
     }
   sincos_stats.inserted++;
 
@@ -826,11 +828,12 @@ execute_cse_sincos_1 (tree name)
        }
 
        /* Replace call with a copy.  */
-       stmt = gimple_build_assign (gimple_call_lhs (use_stmt), rhs);
+       gassign *assign_stmt = gimple_build_assign (gimple_call_lhs (use_stmt),
+                                                   rhs);
 
        gsi = gsi_for_stmt (use_stmt);
-       gsi_replace (&gsi, stmt, true);
-       if (gimple_purge_dead_eh_edges (gimple_bb (stmt)))
+       gsi_replace (&gsi, assign_stmt, true);
+       if (gimple_purge_dead_eh_edges (gimple_bb (assign_stmt)))
          cfg_changed = true;
     }
 
@@ -1115,7 +1118,7 @@ build_and_insert_ref (gimple_stmt_iterator *gsi, 
location_t loc, tree type,
                      const char *name, enum tree_code code, tree arg0)
 {
   tree result = make_temp_ssa_name (type, NULL, name);
-  gimple stmt = gimple_build_assign (result, build1 (code, type, arg0));
+  gassign *stmt = gimple_build_assign (result, build1 (code, type, arg0));
   gimple_set_location (stmt, loc);
   gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
   return result;
@@ -2201,7 +2204,7 @@ bswap_replace (gimple cur_stmt, gimple_stmt_iterator gsi, 
gimple src_stmt,
       gimple_stmt_iterator gsi_ins = gsi_for_stmt (src_stmt);
       tree addr_expr, addr_tmp, val_expr, val_tmp;
       tree load_offset_ptr, aligned_load_type;
-      gimple addr_stmt, load_stmt;
+      gassign *load_stmt;
       unsigned align;
 
       align = get_object_alignment (src);
@@ -2222,7 +2225,7 @@ bswap_replace (gimple cur_stmt, gimple_stmt_iterator gsi, 
gimple src_stmt,
        {
          addr_tmp = make_temp_ssa_name (TREE_TYPE (addr_expr), NULL,
                                         "load_src");
-         addr_stmt = gimple_build_assign (addr_tmp, addr_expr);
+         gassign *addr_stmt = gimple_build_assign (addr_tmp, addr_expr);
          gsi_insert_before (&gsi, addr_stmt, GSI_SAME_STMT);
        }
 
@@ -2299,7 +2302,7 @@ bswap_replace (gimple cur_stmt, gimple_stmt_iterator gsi, 
gimple src_stmt,
   /* Convert the src expression if necessary.  */
   if (!useless_type_conversion_p (TREE_TYPE (tmp), bswap_type))
     {
-      gimple convert_stmt;
+      gassign *convert_stmt;
       tmp = make_temp_ssa_name (bswap_type, NULL, "bswapsrc");
       convert_stmt = gimple_build_assign_with_ops (NOP_EXPR, tmp, src, NULL);
       gsi_insert_before (&gsi, convert_stmt, GSI_SAME_STMT);
@@ -2312,7 +2315,7 @@ bswap_replace (gimple cur_stmt, gimple_stmt_iterator gsi, 
gimple src_stmt,
   /* Convert the result if necessary.  */
   if (!useless_type_conversion_p (TREE_TYPE (tgt), bswap_type))
     {
-      gimple convert_stmt;
+      gassign *convert_stmt;
       tmp = make_temp_ssa_name (bswap_type, NULL, "bswapdst");
       convert_stmt = gimple_build_assign_with_ops (NOP_EXPR, tgt, tmp, NULL);
       gsi_insert_after (&gsi, convert_stmt, GSI_SAME_STMT);
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index ccb6c6b..dafd82d 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -1301,7 +1301,8 @@ neg_replacement (basic_block cond_bb, basic_block 
middle_bb,
                 edge e0 ATTRIBUTE_UNUSED, edge e1,
                 gimple phi, tree arg0, tree arg1)
 {
-  gimple new_stmt, cond;
+  gassign *new_stmt;
+  gimple cond;
   gimple_stmt_iterator gsi;
   gimple assign;
   edge true_edge, false_edge;
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 886e6fc2..5973e64 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4020,7 +4020,7 @@ eliminate_dom_walker::before_dom_children (basic_block b)
 
          if (!useless_type_conversion_p (TREE_TYPE (res), TREE_TYPE (sprime)))
            sprime = fold_convert (TREE_TYPE (res), sprime);
-         gimple stmt = gimple_build_assign (res, sprime);
+         gassign *stmt = gimple_build_assign (res, sprime);
          /* ???  It cannot yet be necessary (DOM walk).  */
          gimple_set_plf (stmt, NECESSARY, gimple_plf (phi, NECESSARY));
 
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index dec357a..a1714fd 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -2591,7 +2591,7 @@ optimize_range_tests_to_bit_test (enum tree_code opcode, 
int first, int length,
          gimple_seq_add_seq_without_update (&seq, seq2);
          gcc_assert (TREE_CODE (exp) == SSA_NAME);
          gimple_set_visited (SSA_NAME_DEF_STMT (exp), true);
-         gimple g
+         gassign *g
            = gimple_build_assign_with_ops (BIT_IOR_EXPR,
                                            make_ssa_name (optype, NULL),
                                            tem, exp);
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 4d35bc9..f9cfed5 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -416,7 +416,9 @@ get_string_length (strinfo si)
 
   if (si->stmt)
     {
-      gimple stmt = si->stmt, lenstmt;
+      gimple stmt = si->stmt;
+      gcall *call_stmt;
+      gassign *assign_stmt;
       tree callee, lhs, fn, tem;
       location_t loc;
       gimple_stmt_iterator gsi;
@@ -440,11 +442,11 @@ get_string_length (strinfo si)
          fn = builtin_decl_implicit (BUILT_IN_STRLEN);
          gcc_assert (lhs == NULL_TREE);
          tem = unshare_expr (gimple_call_arg (stmt, 0));
-         lenstmt = gimple_build_call (fn, 1, tem);
-         lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), lenstmt);
-         gimple_call_set_lhs (lenstmt, lhs);
-         gimple_set_vuse (lenstmt, gimple_vuse (stmt));
-         gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
+         call_stmt = gimple_build_call (fn, 1, tem);
+         lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), call_stmt);
+         gimple_call_set_lhs (call_stmt, lhs);
+         gimple_set_vuse (call_stmt, gimple_vuse (stmt));
+         gsi_insert_before (&gsi, call_stmt, GSI_SAME_STMT);
          tem = gimple_call_arg (stmt, 0);
           if (!ptrofftype_p (TREE_TYPE (lhs)))
             {
@@ -452,13 +454,13 @@ get_string_length (strinfo si)
               lhs = force_gimple_operand_gsi (&gsi, lhs, true, NULL_TREE,
                                               true, GSI_SAME_STMT);
             }
-         lenstmt
+         assign_stmt
            = gimple_build_assign_with_ops
                (POINTER_PLUS_EXPR,
                 make_ssa_name (TREE_TYPE (gimple_call_arg (stmt, 0)), NULL),
                 tem, lhs);
-         gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
-         gimple_call_set_arg (stmt, 0, gimple_assign_lhs (lenstmt));
+         gsi_insert_before (&gsi, assign_stmt, GSI_SAME_STMT);
+         gimple_call_set_arg (stmt, 0, gimple_assign_lhs (assign_stmt));
          lhs = NULL_TREE;
          /* FALLTHRU */
        case BUILT_IN_STRCPY:
@@ -1673,7 +1675,7 @@ handle_builtin_memset (gimple_stmt_iterator *gsi)
   unlink_stmt_vdef (stmt2);
   if (lhs)
     {
-      gimple assign = gimple_build_assign (lhs, ptr);
+      gassign *assign = gimple_build_assign (lhs, ptr);
       gsi_replace (gsi, assign, false);
     }
   else
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 334d775..074b5a4 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -1037,7 +1037,7 @@ build_one_array (gswitch *swtch, int num, tree 
arr_index_type,
                 gphi *phi, tree tidx, struct switch_conv_info *info)
 {
   tree name, cst;
-  gimple load;
+  gassign *load;
   gimple_stmt_iterator gsi = gsi_for_stmt (swtch);
   location_t loc = gimple_location (swtch);
 
@@ -1103,7 +1103,7 @@ build_arrays (gswitch *swtch, struct switch_conv_info 
*info)
 {
   tree arr_index_type;
   tree tidx, sub, utype;
-  gimple stmt;
+  gassign *stmt;
   gimple_stmt_iterator gsi;
   gphi_iterator gpi;
   int i;
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index de6a531..eeeab25 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4057,7 +4057,7 @@ vect_create_data_ref_ptr (gimple stmt, tree aggr_type, 
struct loop *at_loop,
   tree aggr_ptr_type;
   tree aggr_ptr;
   tree new_temp;
-  gimple vec_stmt;
+  gassign *vec_stmt;
   gimple_seq new_stmt_list = NULL;
   edge pe = NULL;
   basic_block new_bb;
@@ -4591,7 +4591,7 @@ vect_permute_store_chain (vec<tree> dr_chain,
                          vec<tree> *result_chain)
 {
   tree vect1, vect2, high, low;
-  gimple perm_stmt;
+  gassign *perm_stmt;
   tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
   tree perm_mask_low, perm_mask_high;
   tree data_ref;
@@ -5164,7 +5164,7 @@ vect_permute_load_chain (vec<tree> dr_chain,
   tree data_ref, first_vect, second_vect;
   tree perm_mask_even, perm_mask_odd;
   tree perm3_mask_low, perm3_mask_high;
-  gimple perm_stmt;
+  gassign *perm_stmt;
   tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
   unsigned int i, j, log_length = exact_log2 (length);
   unsigned nelt = TYPE_VECTOR_SUBPARTS (vectype);
@@ -5363,7 +5363,7 @@ vect_shift_permute_load_chain (vec<tree> dr_chain,
   tree vect[3], vect_shift[3], data_ref, first_vect, second_vect;
   tree perm2_mask1, perm2_mask2, perm3_mask;
   tree select_mask, shift1_mask, shift2_mask, shift3_mask, shift4_mask;
-  gimple perm_stmt;
+  gassign *perm_stmt;
 
   tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
   unsigned int i;
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 55ab637..6d9029a 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -629,7 +629,7 @@ expand_vector_divmod (gimple_stmt_iterator *gsi, tree type, 
tree op0,
              && expand_vec_cond_expr_p (type, type))
            {
              tree zero, cst, cond;
-             gimple stmt;
+             gassign *stmt;
 
              zero = build_zero_cst (type);
              cond = build2 (LT_EXPR, type, op0, zero);
@@ -1136,7 +1136,7 @@ static tree
 vector_element (gimple_stmt_iterator *gsi, tree vect, tree idx, tree *ptmpvec)
 {
   tree vect_type, vect_elt_type;
-  gimple asgn;
+  gassign *asgn;
   tree tmpvec;
   tree arraytype;
   bool need_asgn = true;
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index cb76ade..f97ac0f 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -2121,7 +2121,7 @@ vect_create_cond_for_align_checks (loop_vec_info 
loop_vinfo,
   char tmp_name[20];
   tree or_tmp_name = NULL_TREE;
   tree and_tmp_name;
-  gimple and_stmt;
+  gassign *and_stmt;
   tree ptrsize_zero;
   tree part_cond_expr;
 
@@ -2140,7 +2140,7 @@ vect_create_cond_for_align_checks (loop_vec_info 
loop_vinfo,
       tree addr_base;
       tree addr_tmp_name;
       tree new_or_tmp_name;
-      gimple addr_stmt, or_stmt;
+      gassign *addr_stmt, *or_stmt;
       stmt_vec_info stmt_vinfo = vinfo_for_stmt (ref_stmt);
       tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
       bool negative = tree_int_cst_compare
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 5149db7..4bfa089 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2502,8 +2502,8 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, 
gimple phi,
     {
       tree rhs = gimple_assign_rhs2 (def_stmt);
       tree negrhs = make_ssa_name (TREE_TYPE (rhs), NULL);
-      gimple negate_stmt = gimple_build_assign_with_ops (NEGATE_EXPR, negrhs,
-                                                        rhs, NULL);
+      gassign *negate_stmt =  gimple_build_assign_with_ops (NEGATE_EXPR, 
negrhs,
+                                                           rhs, NULL);
       gimple_stmt_iterator gsi = gsi_for_stmt (def_stmt);
       set_vinfo_for_stmt (negate_stmt, new_stmt_vec_info (negate_stmt, 
                                                          loop_info, NULL));
@@ -3271,7 +3271,7 @@ get_initial_def_for_induction (gimple iv_phi)
   tree new_vec, vec_init, vec_step, t;
   tree new_var;
   tree new_name;
-  gimple init_stmt, new_stmt;
+  gassign *init_stmt, *new_stmt;
   gphi *induction_phi;
   tree induc_def, vec_def, vec_dest;
   tree init_expr, step_expr;
@@ -4769,7 +4769,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator 
*gsi,
   stmt_vec_info prev_stmt_info, prev_phi_info;
   bool single_defuse_cycle = false;
   tree reduc_def = NULL_TREE;
-  gimple new_stmt = NULL;
+  gassign *new_stmt = NULL;
   int j;
   tree ops[3];
   bool nested_cycle = false, found_nested_cycle_def = false;
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index b84248e..61d4b04 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -286,7 +286,7 @@ vect_recog_dot_prod_pattern (vec<gimple> *stmts, tree 
*type_in,
   tree oprnd00, oprnd01;
   stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
   tree type, half_type;
-  gimple pattern_stmt;
+  gassign *pattern_stmt;
   tree prod_type;
   loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
   struct loop *loop;
@@ -672,8 +672,8 @@ vect_recog_sad_pattern (vec<gimple> *stmts, tree *type_in,
 
   /* Pattern detected. Create a stmt to be used to replace the pattern: */
   tree var = vect_recog_temp_ssa_var (sum_type, NULL);
-  gimple pattern_stmt = gimple_build_assign_with_ops
-                          (SAD_EXPR, var, sad_oprnd0, sad_oprnd1, plus_oprnd1);
+  gassign *pattern_stmt = gimple_build_assign_with_ops (
+                           SAD_EXPR, var, sad_oprnd0, sad_oprnd1, plus_oprnd1);
 
   if (dump_enabled_p ())
     {
@@ -856,7 +856,7 @@ vect_recog_widen_mult_pattern (vec<gimple> *stmts,
   gimple def_stmt0, def_stmt1;
   tree oprnd0, oprnd1;
   tree type, half_type0, half_type1;
-  gimple new_stmt = NULL, pattern_stmt = NULL;
+  gassign *new_stmt = NULL, *pattern_stmt = NULL;
   tree vectype, vecitype;
   tree var;
   enum tree_code dummy_code;
@@ -1190,7 +1190,7 @@ vect_recog_widen_sum_pattern (vec<gimple> *stmts, tree 
*type_in,
   tree oprnd0, oprnd1;
   stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
   tree type, half_type;
-  gimple pattern_stmt;
+  gassign *pattern_stmt;
   loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
   struct loop *loop;
   tree var;
@@ -1504,7 +1504,8 @@ vect_recog_over_widening_pattern (vec<gimple> *stmts,
                                   tree *type_in, tree *type_out)
 {
   gimple stmt = stmts->pop ();
-  gimple pattern_stmt = NULL, new_def_stmt, prev_stmt = NULL, use_stmt = NULL;
+  gassign *pattern_stmt = NULL;
+  gimple new_def_stmt, prev_stmt = NULL, use_stmt = NULL;
   tree op0, op1, vectype = NULL_TREE, use_lhs, use_type;
   tree var = NULL_TREE, new_type = NULL_TREE, new_oprnd;
   bool first;
@@ -1699,7 +1700,7 @@ vect_recog_widen_shift_pattern (vec<gimple> *stmts,
   gimple def_stmt0;
   tree oprnd0, oprnd1;
   tree type, half_type0;
-  gimple pattern_stmt;
+  gassign *pattern_stmt;
   tree vectype, vectype_out = NULL_TREE;
   tree var;
   enum tree_code dummy_code;
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 0e9abdb..05ba780 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2604,7 +2604,7 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
                {
                  tree new_temp
                    = make_ssa_name (TREE_TYPE (vector_type), NULL);
-                 gimple init_stmt;
+                 gassign *init_stmt;
                  op = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (vector_type),
                               op);               
                  init_stmt
@@ -2813,7 +2813,7 @@ vect_create_mask_and_perm (gimple stmt, gimple 
next_scalar_stmt,
                            int ncopies, int vect_stmts_counter)
 {
   tree perm_dest;
-  gimple perm_stmt = NULL;
+  gassign *perm_stmt = NULL;
   stmt_vec_info next_stmt_info;
   int i, stride;
   tree first_vec, second_vec, data_ref;
@@ -3189,7 +3189,8 @@ vect_schedule_slp_instance (slp_tree node, slp_instance 
instance,
 static void
 vect_remove_slp_scalar_calls (slp_tree node)
 {
-  gimple stmt, new_stmt;
+  gimple stmt;
+  gassign *new_stmt;
   gimple_stmt_iterator gsi;
   int i;
   slp_tree child;
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 02ac7d0..a282cea 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -150,7 +150,7 @@ read_vector_array (gimple stmt, gimple_stmt_iterator *gsi, 
tree scalar_dest,
                   tree array, unsigned HOST_WIDE_INT n)
 {
   tree vect_type, vect, vect_name, array_ref;
-  gimple new_stmt;
+  gassign *new_stmt;
 
   gcc_assert (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE);
   vect_type = TREE_TYPE (TREE_TYPE (array));
@@ -176,7 +176,7 @@ write_vector_array (gimple stmt, gimple_stmt_iterator *gsi, 
tree vect,
                    tree array, unsigned HOST_WIDE_INT n)
 {
   tree array_ref;
-  gimple new_stmt;
+  gassign *new_stmt;
 
   array_ref = build4 (ARRAY_REF, TREE_TYPE (vect), array,
                      build_int_cst (size_type_node, n),
@@ -1314,7 +1314,7 @@ tree
 vect_init_vector (gimple stmt, tree val, tree type, gimple_stmt_iterator *gsi)
 {
   tree new_var;
-  gimple init_stmt;
+  gassign *init_stmt;
   tree vec_oprnd;
   tree new_temp;
 
@@ -2465,7 +2465,7 @@ vectorizable_call (gimple gs, gimple_stmt_iterator *gsi, 
gimple *vec_stmt,
              tree cst = build_vector (vectype_out, v);
              tree new_var
                = vect_get_new_vect_var (vectype_out, vect_simple_var, "cst_");
-             gimple init_stmt = gimple_build_assign (new_var, cst);
+             gassign *init_stmt = gimple_build_assign (new_var, cst);
              new_temp = make_ssa_name (new_var, init_stmt);
              gimple_assign_set_lhs (init_stmt, new_temp);
              vect_init_vector_1 (stmt, init_stmt, NULL);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 43ffcfe..23bef4a 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -9555,8 +9555,8 @@ simplify_internal_call_using_ranges (gimple_stmt_iterator 
*gsi, gimple stmt)
        }
     }
 
-  gimple g = gimple_build_assign_with_ops (subcode, gimple_call_lhs (stmt),
-                                          op0, op1);
+  gassign *g = gimple_build_assign_with_ops (subcode, gimple_call_lhs (stmt),
+                                            op0, op1);
   gsi_replace (gsi, g, false);
   return true;
 }
diff --git a/gcc/tsan.c b/gcc/tsan.c
index 0577104..8443a6d 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -115,7 +115,7 @@ instrument_expr (gimple_stmt_iterator gsi, tree expr, bool 
is_write)
   tree base, rhs, expr_ptr, builtin_decl;
   basic_block bb;
   HOST_WIDE_INT size;
-  gimple stmt, g;
+  gimple stmt;
   gimple_seq seq;
   location_t loc;
 
@@ -165,12 +165,13 @@ instrument_expr (gimple_stmt_iterator gsi, tree expr, 
bool is_write)
   seq = NULL;
   if (!is_gimple_val (expr_ptr))
     {
-      g = gimple_build_assign (make_ssa_name (TREE_TYPE (expr_ptr), NULL),
-                              expr_ptr);
+      gassign *g = gimple_build_assign (make_ssa_name (TREE_TYPE (expr_ptr), 
NULL),
+                                       expr_ptr);
       expr_ptr = gimple_assign_lhs (g);
       gimple_set_location (g, loc);
       gimple_seq_add_stmt_without_update (&seq, g);
     }
+  gcall *g;
   if (rhs == NULL)
     g = gimple_build_call (get_memory_access_decl (is_write, size),
                           1, expr_ptr);
@@ -443,7 +444,8 @@ static const struct tsan_map_atomic
 static void
 instrument_builtin_call (gimple_stmt_iterator *gsi)
 {
-  gimple stmt = gsi_stmt (*gsi), g;
+  gimple stmt = gsi_stmt (*gsi);
+  gassign *g;
   tree callee = gimple_call_fndecl (stmt), last_arg, args[6], t, lhs;
   enum built_in_function fcode = DECL_FUNCTION_CODE (callee);
   unsigned int i, num = gimple_call_num_args (stmt), j;
-- 
1.7.11.7

Reply via email to