This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)


On Mon, 2013-11-04 at 08:19 -0500, Andrew MacLeod wrote:
> On 11/01/2013 06:58 PM, David Malcolm wrote:
> > On Fri, 2013-11-01 at 22:57 +0100, Jakub Jelinek wrote:
> >> On Fri, Nov 01, 2013 at 05:47:14PM -0400, Andrew MacLeod wrote:
> >>> On 11/01/2013 05:41 PM, Jakub Jelinek wrote:
> >>>> On Fri, Nov 01, 2013 at 05:36:34PM -0400, Andrew MacLeod wrote:
> >>>>>    static inline void
> >>>>> ! gimple_call_set_lhs (gimple gs, tree lhs)
> >>>>>    {
> >>>>> -   GIMPLE_CHECK (gs, GIMPLE_CALL);
> >> The checking you are removing here.
> >>
> >>> What checking?  There ought to be no checking at all in this
> >>> example...  gimple_build_call_vec returns a gimple_call, and
> >>> gimple_call_set_lhs()  doesn't have to check anything because it
> >>> only accepts gimple_call's.. so there is no checking other than the
> >>> usual "does my parameter match" that the compiler has to do...
> >> and want to replace it by checking of the types at compile time.
> >> The problem is that it uglifies the source too much, and, when you
> >> actually don't have a gimple_call but supposedly a base class of it,
> >> I expect you'd do as_a which is not only further uglification, but has
> >> runtime cost also for --enable-checking=release.
> > I can have a look next week at every call to gimple_call_set_lhs in the
> > tree, and see to what extent we know at compile-time that the initial
> > arg is indeed a call (of the ones I quickly grepped just now, most are
> > from gimple_build_call and friends, but one was from a gimple_copy).
> >
> > FWIW I did some performance testing of the is_a/as_a code in the earlier
> > version of the patch, and it didn't have a noticable runtime cost
> > compared to the GIMPLE_CHECK in the existing code:
> > Size of compiler executable:
> > http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01920.html
> > Compile times:
> > http://gcc.gnu.org/ml/gcc-patches/2013-09/msg00171.html
> I actually really dislike as_a<> and is_a<>, and  think code needs to be 
> restructured rather than use them, other than possibly at the very 
> bottom level when we're allocating memory or something like that, or 
> some kind of emergency :-)...   If we require frequent uses of those, 
> I'd be against it, I find them quite ugly.
> 
> Like I said in the other reply, no rush, I don't think any of this 
> follow up is appropriate this late in stage 1.  It would be more of an 
> "interest" examination right now.. at least in my opinion...  I suspect 
> thinks like gimple_assign are more complex cases, but without looking 
> its hard to tell for sure.

I tried converting gimple_call_set_lhs to accept a gimple_call, rather
than a gimple, and excitingly, it was easiest to also convert
cgraph_edge's call_stmt to also be a gimple_call, rather than just a
gimple.

Am attaching a patch (on top of the patch series being discussed) which
adds this compile-time typesafety; bootstrap is in-progress.   IMHO very
little use of is-a.h was needed (5 instances of as_a, and 3 of dyn_cast;
no use of is_a).

I'm also attaching a followup patch which eliminates gimple_call_set_lhs
in favor of a method of gimple_statement_call.

commit ea57d6c7d3920cf27b23b7e978194a69be5f0071
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Mon Nov 4 15:22:45 2013 -0500

    FIXME: gimple_call_set_lhs (without methods)

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 4a4e9ac..6156993 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -764,7 +764,7 @@ cgraph_edge (struct cgraph_node *node, gimple call_stmt)
    edge, then update all components.  */
 
 void
-cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt,
+cgraph_set_call_stmt (struct cgraph_edge *e, gimple_call new_stmt,
 		      bool update_speculative)
 {
   tree decl;
@@ -817,7 +817,7 @@ cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt,
 
 static struct cgraph_edge *
 cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
-		       gimple call_stmt, gcov_type count, int freq,
+		       gimple_call call_stmt, gcov_type count, int freq,
 		       bool indir_unknown_callee)
 {
   struct cgraph_edge *edge;
@@ -889,7 +889,7 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
 
 struct cgraph_edge *
 cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
-		    gimple call_stmt, gcov_type count, int freq)
+		    gimple_call call_stmt, gcov_type count, int freq)
 {
   struct cgraph_edge *edge = cgraph_create_edge_1 (caller, callee, call_stmt,
 						   count, freq, false);
@@ -925,7 +925,7 @@ cgraph_allocate_init_indirect_info (void)
    PARAM_INDEX. */
 
 struct cgraph_edge *
-cgraph_create_indirect_edge (struct cgraph_node *caller, gimple call_stmt,
+cgraph_create_indirect_edge (struct cgraph_node *caller, gimple_call call_stmt,
 			     int ecf_flags,
 			     gcov_type count, int freq)
 {
@@ -1298,7 +1298,7 @@ gimple
 cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
 {
   tree decl = gimple_call_fndecl (e->call_stmt);
-  gimple new_stmt;
+  gimple_call new_stmt;
   gimple_stmt_iterator gsi;
 #ifdef ENABLE_CHECKING
   struct cgraph_node *node;
@@ -1307,7 +1307,6 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
   if (e->speculative)
     {
       struct cgraph_edge *e2;
-      gimple new_stmt;
       struct ipa_ref *ref;
 
       cgraph_speculative_call_info (e, e, e2, ref);
@@ -1459,7 +1458,7 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
 static void
 cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
 					gimple old_stmt, tree old_call,
-					gimple new_stmt)
+					gimple_call new_stmt)
 {
   tree new_call = (new_stmt && is_gimple_call (new_stmt))
 		  ? gimple_call_fndecl (new_stmt) : 0;
@@ -1526,7 +1525,8 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
    of OLD_STMT before it was updated (updating can happen inplace).  */
 
 void
-cgraph_update_edges_for_call_stmt (gimple old_stmt, tree old_decl, gimple new_stmt)
+cgraph_update_edges_for_call_stmt (gimple old_stmt, tree old_decl,
+				   gimple_call new_stmt)
 {
   struct cgraph_node *orig = cgraph_get_node (cfun->decl);
   struct cgraph_node *node;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 9171a79..9fab47b 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -458,7 +458,7 @@ struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgrap
   struct cgraph_edge *next_caller;
   struct cgraph_edge *prev_callee;
   struct cgraph_edge *next_callee;
-  gimple call_stmt;
+  gimple_call call_stmt;
   /* Additional information about an indirect call.  Not cleared when an edge
      becomes direct.  */
   struct cgraph_indirect_call_info *indirect_info;
@@ -626,8 +626,9 @@ void release_function_body (tree);
 void cgraph_node_remove_callees (struct cgraph_node *node);
 struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
 					struct cgraph_node *,
-					gimple, gcov_type, int);
-struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *, gimple,
+					gimple_call, gcov_type, int);
+struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *,
+						 gimple_call,
 						 int, gcov_type, int);
 struct cgraph_indirect_call_info *cgraph_allocate_init_indirect_info (void);
 struct cgraph_node * cgraph_create_node (tree);
@@ -639,8 +640,8 @@ struct cgraph_node * cgraph_add_thunk (struct cgraph_node *, tree, tree, bool, H
 				       HOST_WIDE_INT, tree, tree);
 struct cgraph_node *cgraph_node_for_asm (tree);
 struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple);
-void cgraph_set_call_stmt (struct cgraph_edge *, gimple, bool update_speculative = true);
-void cgraph_update_edges_for_call_stmt (gimple, tree, gimple);
+void cgraph_set_call_stmt (struct cgraph_edge *, gimple_call, bool update_speculative = true);
+void cgraph_update_edges_for_call_stmt (gimple, tree, gimple_call);
 struct cgraph_local_info *cgraph_local_info (tree);
 struct cgraph_global_info *cgraph_global_info (tree);
 struct cgraph_rtl_info *cgraph_rtl_info (tree);
@@ -748,7 +749,7 @@ bool expand_thunk (struct cgraph_node *, bool);
 /* In cgraphclones.c  */
 
 struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
-					struct cgraph_node *, gimple,
+					struct cgraph_node *, gimple_call,
 					unsigned, gcov_type, int, bool);
 struct cgraph_node * cgraph_clone_node (struct cgraph_node *, tree, gcov_type,
 					int, bool, vec<cgraph_edge_p>,
@@ -761,11 +762,11 @@ struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node *old_node,
 						  const char *clone_name);
 struct cgraph_node *cgraph_find_replacement_node (struct cgraph_node *);
 bool cgraph_remove_node_and_inline_clones (struct cgraph_node *, struct cgraph_node *);
-void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple,
+void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple_call,
 					    bool update_speculative = true);
 void cgraph_create_edge_including_clones (struct cgraph_node *,
 					  struct cgraph_node *,
-					  gimple, gimple, gcov_type, int,
+					  gimple, gimple_call, gcov_type, int,
 					  cgraph_inline_failed_t);
 void cgraph_materialize_all_clones (void);
 struct cgraph_node * cgraph_copy_node_for_versioning (struct cgraph_node *,
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 1490cb7..b5f459d 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -319,16 +319,16 @@ build_cgraph_edges (void)
 	  if (is_gimple_debug (stmt))
 	    continue;
 
-	  if (is_gimple_call (stmt))
+	  if (gimple_call call_stmt = dyn_cast<gimple_statement_call> (stmt))
 	    {
 	      int freq = compute_call_stmt_bb_frequency (current_function_decl,
 							 bb);
 	      decl = gimple_call_fndecl (stmt);
 	      if (decl)
 		cgraph_create_edge (node, cgraph_get_create_node (decl),
-				    stmt, bb->count, freq);
+				    call_stmt, bb->count, freq);
 	      else
-		cgraph_create_indirect_edge (node, stmt,
+		cgraph_create_indirect_edge (node, call_stmt,
 					     gimple_call_flags (stmt),
 					     bb->count, freq);
 	    }
@@ -448,16 +448,16 @@ rebuild_cgraph_edges (void)
 	  gimple stmt = gsi_stmt (gsi);
 	  tree decl;
 
-	  if (is_gimple_call (stmt))
+	  if (gimple_call call_stmt = dyn_cast<gimple_statement_call> (stmt))
 	    {
 	      int freq = compute_call_stmt_bb_frequency (current_function_decl,
 							 bb);
 	      decl = gimple_call_fndecl (stmt);
 	      if (decl)
-		cgraph_create_edge (node, cgraph_get_create_node (decl), stmt,
+		cgraph_create_edge (node, cgraph_get_create_node (decl), call_stmt,
 				    bb->count, freq);
 	      else
-		cgraph_create_indirect_edge (node, stmt,
+		cgraph_create_indirect_edge (node, call_stmt,
 					     gimple_call_flags (stmt),
 					     bb->count, freq);
 	    }
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 373f501..e607e27 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -98,8 +98,8 @@ along with GCC; see the file COPYING3.  If not see
 /* Create clone of E in the node N represented by CALL_EXPR the callgraph.  */
 struct cgraph_edge *
 cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
-		   gimple call_stmt, unsigned stmt_uid, gcov_type count_scale,
-		   int freq_scale, bool update_original)
+		   gimple_call call_stmt, unsigned stmt_uid,
+		   gcov_type count_scale, int freq_scale, bool update_original)
 {
   struct cgraph_edge *new_edge;
   gcov_type count = apply_probability (e->count, count_scale);
@@ -488,7 +488,7 @@ cgraph_find_replacement_node (struct cgraph_node *node)
 
 void
 cgraph_set_call_stmt_including_clones (struct cgraph_node *orig,
-				       gimple old_stmt, gimple new_stmt,
+				       gimple old_stmt, gimple_call new_stmt,
 				       bool update_speculative)
 {
   struct cgraph_node *node;
@@ -545,7 +545,7 @@ void
 cgraph_create_edge_including_clones (struct cgraph_node *orig,
 				     struct cgraph_node *callee,
 				     gimple old_stmt,
-				     gimple stmt, gcov_type count,
+				     gimple_call stmt, gcov_type count,
 				     int freq,
 				     cgraph_inline_failed_t reason)
 {
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 39fb142..a9ab226 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1519,7 +1519,7 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
       tree restmp = NULL;
       vec<tree> vargs;
 
-      gimple call;
+      gimple_call call;
       gimple ret;
 
       if (in_lto_p)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3131efd..b76479c 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -29419,7 +29419,7 @@ add_condition_to_bb (tree function_decl, tree version_decl,
   gimple return_stmt;
   tree convert_expr, result_var;
   gimple convert_stmt;
-  gimple call_cond_stmt;
+  gimple_call call_cond_stmt;
   gimple if_else_stmt;
 
   basic_block bb1, bb2, bb3;
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 5d60240..5a5cfbb 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -66,6 +66,9 @@ typedef const struct gimple_statement_base *const_gimple;
 typedef gimple gimple_seq;
 struct gimple_stmt_iterator_d;
 typedef struct gimple_stmt_iterator_d gimple_stmt_iterator;
+/* FWIW I'd rather simply have the class be called "gimple_call", and
+   make the pointerness be explicit rather than implicit.  */
+typedef struct gimple_statement_call *gimple_call;
 union section;
 typedef union section section;
 struct gcc_options;
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index d527d86..b24961b 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -142,6 +142,7 @@ lower_function_body (void)
   if (data.calls_builtin_setjmp)
     {
       tree disp_label, disp_var, arg;
+      gimple_call call;
 
       /* Build 'DISP_LABEL:' and insert.  */
       disp_label = create_artificial_label (cfun->function_end_locus);
@@ -156,11 +157,11 @@ lower_function_body (void)
       disp_var = create_tmp_var (ptr_type_node, "setjmpvar");
       arg = build_addr (disp_label, current_function_decl);
       t = builtin_decl_implicit (BUILT_IN_SETJMP_DISPATCHER);
-      x = gimple_build_call (t, 1, arg);
-      gimple_call_set_lhs (x, disp_var);
+      call = gimple_build_call (t, 1, arg);
+      gimple_call_set_lhs (call, disp_var);
+      gsi_insert_after (&i, call, GSI_CONTINUE_LINKING);
 
       /* Build 'goto DISP_VAR;' and insert.  */
-      gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
       x = gimple_build_goto (disp_var);
       gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
     }
diff --git a/gcc/gimple.c b/gcc/gimple.c
index e9ef8e0..f31c935 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -200,10 +200,12 @@ gimple_call_reset_alias_info (gimple s)
    components of a GIMPLE_CALL statement to function FN with NARGS
    arguments.  */
 
-static inline gimple
+static inline gimple_call
 gimple_build_call_1 (tree fn, unsigned nargs)
 {
-  gimple s = gimple_build_with_ops (GIMPLE_CALL, ERROR_MARK, nargs + 3);
+  gimple_call s =
+    static_cast<gimple_call> (gimple_build_with_ops (GIMPLE_CALL, ERROR_MARK,
+						     nargs + 3));
   if (TREE_CODE (fn) == FUNCTION_DECL)
     fn = build_fold_addr_expr (fn);
   gimple_set_op (s, 1, fn);
@@ -216,12 +218,12 @@ gimple_build_call_1 (tree fn, unsigned nargs)
 /* Build a GIMPLE_CALL statement to function FN with the arguments
    specified in vector ARGS.  */
 
-gimple
+gimple_call
 gimple_build_call_vec (tree fn, vec<tree> args)
 {
   unsigned i;
   unsigned nargs = args.length ();
-  gimple call = gimple_build_call_1 (fn, nargs);
+  gimple_call call = gimple_build_call_1 (fn, nargs);
 
   for (i = 0; i < nargs; i++)
     gimple_call_set_arg (call, i, args[i]);
@@ -233,11 +235,11 @@ gimple_build_call_vec (tree fn, vec<tree> args)
 /* Build a GIMPLE_CALL statement to function FN.  NARGS is the number of
    arguments.  The ... are the arguments.  */
 
-gimple
+gimple_call
 gimple_build_call (tree fn, unsigned nargs, ...)
 {
   va_list ap;
-  gimple call;
+  gimple_call call;
   unsigned i;
 
   gcc_assert (TREE_CODE (fn) == FUNCTION_DECL || is_gimple_call_addr (fn));
@@ -256,10 +258,10 @@ gimple_build_call (tree fn, unsigned nargs, ...)
 /* Build a GIMPLE_CALL statement to function FN.  NARGS is the number of
    arguments.  AP contains the arguments.  */
 
-gimple
+gimple_call
 gimple_build_call_valist (tree fn, unsigned nargs, va_list ap)
 {
-  gimple call;
+  gimple_call call;
   unsigned i;
 
   gcc_assert (TREE_CODE (fn) == FUNCTION_DECL || is_gimple_call_addr (fn));
@@ -277,10 +279,12 @@ gimple_build_call_valist (tree fn, unsigned nargs, va_list ap)
    Build the basic components of a GIMPLE_CALL statement to internal
    function FN with NARGS arguments.  */
 
-static inline gimple
+static inline gimple_call
 gimple_build_call_internal_1 (enum internal_fn fn, unsigned nargs)
 {
-  gimple s = gimple_build_with_ops (GIMPLE_CALL, ERROR_MARK, nargs + 3);
+  gimple_call s =
+    static_cast<gimple_call> (gimple_build_with_ops (GIMPLE_CALL, ERROR_MARK,
+						     nargs + 3));
   s->subcode |= GF_CALL_INTERNAL;
   gimple_call_set_internal_fn (s, fn);
   gimple_call_reset_alias_info (s);
@@ -291,11 +295,11 @@ gimple_build_call_internal_1 (enum internal_fn fn, unsigned nargs)
 /* Build a GIMPLE_CALL statement to internal function FN.  NARGS is
    the number of arguments.  The ... are the arguments.  */
 
-gimple
+gimple_call
 gimple_build_call_internal (enum internal_fn fn, unsigned nargs, ...)
 {
   va_list ap;
-  gimple call;
+  gimple_call call;
   unsigned i;
 
   call = gimple_build_call_internal_1 (fn, nargs);
@@ -311,11 +315,11 @@ gimple_build_call_internal (enum internal_fn fn, unsigned nargs, ...)
 /* Build a GIMPLE_CALL statement to internal function FN with the arguments
    specified in vector ARGS.  */
 
-gimple
+gimple_call
 gimple_build_call_internal_vec (enum internal_fn fn, vec<tree> args)
 {
   unsigned i, nargs;
-  gimple call;
+  gimple_call call;
 
   nargs = args.length ();
   call = gimple_build_call_internal_1 (fn, nargs);
@@ -330,11 +334,11 @@ gimple_build_call_internal_vec (enum internal_fn fn, vec<tree> args)
    assumed to be in GIMPLE form already.  Minimal checking is done of
    this fact.  */
 
-gimple
+gimple_call
 gimple_build_call_from_tree (tree t)
 {
   unsigned i, nargs;
-  gimple call;
+  gimple_call call;
   tree fndecl = get_callee_fndecl (t);
 
   gcc_assert (TREE_CODE (t) == CALL_EXPR);
@@ -2248,7 +2252,7 @@ gimple_set_lhs (gimple stmt, tree lhs)
   if (code == GIMPLE_ASSIGN)
     gimple_assign_set_lhs (stmt, lhs);
   else if (code == GIMPLE_CALL)
-    gimple_call_set_lhs (stmt, lhs);
+    gimple_call_set_lhs (static_cast<gimple_call> (stmt), lhs);
   else
     gcc_unreachable ();
 }
@@ -3059,14 +3063,14 @@ canonicalize_cond_expr_cond (tree t)
 /* Build a GIMPLE_CALL identical to STMT but skipping the arguments in
    the positions marked by the set ARGS_TO_SKIP.  */
 
-gimple
+gimple_call
 gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
 {
   int i;
   int nargs = gimple_call_num_args (stmt);
   vec<tree> vargs;
   vargs.create (nargs);
-  gimple new_stmt;
+  gimple_call new_stmt;
 
   for (i = 0; i < nargs; i++)
     if (!bitmap_bit_p (args_to_skip, i))
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 35bfa06..1180d3e 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1055,12 +1055,12 @@ gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
 #define gimple_build_debug_source_bind(var,val,stmt)			\
   gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
 
-gimple gimple_build_call_vec (tree, vec<tree> );
-gimple gimple_build_call (tree, unsigned, ...);
-gimple gimple_build_call_valist (tree, unsigned, va_list);
-gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
-gimple gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
-gimple gimple_build_call_from_tree (tree);
+gimple_call gimple_build_call_vec (tree, vec<tree> );
+gimple_call gimple_build_call (tree, unsigned, ...);
+gimple_call gimple_build_call_valist (tree, unsigned, va_list);
+gimple_call gimple_build_call_internal (enum internal_fn, unsigned, ...);
+gimple_call gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
+gimple_call gimple_build_call_from_tree (tree);
 gimple gimplify_assign (tree, tree, gimple_seq *);
 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
 gimple gimple_build_label (tree label);
@@ -2551,9 +2551,8 @@ gimple_call_lhs_ptr (const_gimple gs)
 /* Set LHS to be the LHS operand of call statement GS.  */
 
 static inline void
-gimple_call_set_lhs (gimple gs, tree lhs)
+gimple_call_set_lhs (gimple_call gs, tree lhs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
   gimple_set_op (gs, 0, lhs);
   if (lhs && TREE_CODE (lhs) == SSA_NAME)
     SSA_NAME_DEF_STMT (lhs) = gs;
@@ -6134,7 +6133,7 @@ basic_block gsi_insert_on_edge_immediate (edge, gimple);
 basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
 void gsi_commit_one_edge_insert (edge, basic_block *);
 void gsi_commit_edge_inserts (void);
-gimple gimple_call_copy_skip_args (gimple, bitmap);
+gimple_call gimple_call_copy_skip_args (gimple, bitmap);
 
 /* In gimplify.c.  */
 tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5869441..e2c81b9 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1160,7 +1160,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;
 
@@ -1183,7 +1183,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
   tree t;
   gimple gimple_bind;
   gimple_seq body, cleanup;
-  gimple stack_save;
+  gimple_call stack_save;
 
   tree temp = voidify_wrapper_expr (bind_expr, NULL);
 
@@ -1233,7 +1233,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.  */
@@ -3438,7 +3438,7 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value,
     				gimple_seq *seq_p)
 {
   tree t, to, to_ptr, from, from_ptr;
-  gimple gs;
+  gimple_call gs;
   location_t loc = EXPR_LOCATION (*expr_p);
 
   to = TREE_OPERAND (*expr_p, 0);
@@ -3485,7 +3485,7 @@ gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value,
     				gimple_seq *seq_p)
 {
   tree t, from, to, to_ptr;
-  gimple gs;
+  gimple_call gs;
   location_t loc = EXPR_LOCATION (*expr_p);
 
   /* Assert our assumptions, to abort instead of producing wrong code
@@ -4876,11 +4876,12 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
       tree fnptrtype = TREE_TYPE (CALL_EXPR_FN (*from_p));
       CALL_EXPR_FN (*from_p) = TREE_OPERAND (CALL_EXPR_FN (*from_p), 0);
       STRIP_USELESS_TYPE_CONVERSION (CALL_EXPR_FN (*from_p));
-      assign = gimple_build_call_from_tree (*from_p);
+      gimple_call call = gimple_build_call_from_tree (*from_p);
+      assign = call;
       gimple_call_set_fntype (assign, TREE_TYPE (fnptrtype));
       notice_special_calls (assign);
       if (!gimple_call_noreturn_p (assign))
-	gimple_call_set_lhs (assign, *to_p);
+	gimple_call_set_lhs (call, *to_p);
     }
   else
     {
@@ -7789,8 +7790,8 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
 	    tree id = TREE_OPERAND (*expr_p, 1);
 	    tree tmp = create_tmp_var_raw (TREE_TYPE(cond), NULL);
 	    gimplify_arg (&cond, pre_p, EXPR_LOCATION (*expr_p));
-	    gimple call = gimple_build_call_internal (IFN_ANNOTATE, 2,
-						      cond, id);
+	    gimple_call call = gimple_build_call_internal (IFN_ANNOTATE, 2,
+							   cond, id);
 	    gimple_call_set_lhs (call, tmp);
 	    gimplify_seq_add_stmt (pre_p, call);
 	    *expr_p = tmp;
@@ -8989,7 +8990,7 @@ gimplify_function_tree (tree fndecl)
       gimple tf;
       gimple_seq cleanup = NULL, body = NULL;
       tree tmp_var;
-      gimple call;
+      gimple_call call;
 
       x = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS);
       call = gimple_build_call (x, 1, integer_zero_node);
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 1ceabfa..642153d 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -3523,7 +3523,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
   struct cgraph_node *current_node = cgraph_get_node (current_function_decl);
   vec<tree> vargs;
   vec<tree, va_gc> **debug_args = NULL;
-  gimple new_stmt;
+  gimple_call new_stmt;
   gimple_stmt_iterator gsi, prev_gsi;
   tree callee_decl;
   int i, len;
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 849868c..915533c 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1075,7 +1075,7 @@ split_function (struct split_point *split_point)
   basic_block return_bb = find_return_bb ();
   basic_block call_bb;
   gimple_stmt_iterator gsi;
-  gimple call;
+  gimple_call call;
   edge e;
   edge_iterator ei;
   tree retval = NULL, real_retval = NULL;
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index d4a52a7..e9e245a 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -771,7 +771,10 @@ fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple *stmts,
     {
       if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
         fatal_error ("Cgraph edge statement index out of range");
-      cedge->call_stmt = stmts[cedge->lto_stmt_uid - 1];
+      gimple stmt = stmts[cedge->lto_stmt_uid - 1];
+      if (stmt)
+	gcc_assert (stmt->code == GIMPLE_CALL);
+      cedge->call_stmt = static_cast<gimple_call> (stmt);
       if (!cedge->call_stmt)
         fatal_error ("Cgraph edge statement index not found");
     }
@@ -779,7 +782,10 @@ fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple *stmts,
     {
       if (gimple_stmt_max_uid (fn) < cedge->lto_stmt_uid)
         fatal_error ("Cgraph edge statement index out of range");
-      cedge->call_stmt = stmts[cedge->lto_stmt_uid - 1];
+      gimple stmt = stmts[cedge->lto_stmt_uid - 1];
+      if (stmt)
+	gcc_assert (stmt->code == GIMPLE_CALL);
+      cedge->call_stmt = static_cast<gimple_call> (stmt);
       if (!cedge->call_stmt)
         fatal_error ("Cgraph edge statement index not found");
     }
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index a5b9210..dcececc 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -2670,7 +2670,7 @@ build_omp_barrier (tree lhs)
 {
   tree fndecl = builtin_decl_explicit (lhs ? BUILT_IN_GOMP_BARRIER_CANCEL
 					   : BUILT_IN_GOMP_BARRIER);
-  gimple g = gimple_build_call (fndecl, 0);
+  gimple_call g = gimple_build_call (fndecl, 0);
   if (lhs)
     gimple_call_set_lhs (g, lhs);
   return g;
@@ -3099,7 +3099,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 
 	      if (c_kind != OMP_CLAUSE_FIRSTPRIVATE || !is_task_ctx (ctx))
 		{
-		  gimple stmt;
+		  gimple_call stmt;
 		  tree tmp, atmp;
 
 		  ptr = DECL_VALUE_EXPR (new_var);
@@ -3519,27 +3519,28 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
       /* Don't want uninit warnings on simduid, it is always uninitialized,
 	 but we use it not for the value, but for the DECL_UID only.  */
       TREE_NO_WARNING (uid) = 1;
-      gimple g
+      gimple_call call
 	= gimple_build_call_internal (IFN_GOMP_SIMD_LANE, 1, uid);
-      gimple_call_set_lhs (g, lane);
+      gimple_call_set_lhs (call, lane);
       gimple_stmt_iterator gsi = gsi_start_1 (gimple_omp_body_ptr (ctx->stmt));
-      gsi_insert_before_without_update (&gsi, g, GSI_SAME_STMT);
+      gsi_insert_before_without_update (&gsi, call, GSI_SAME_STMT);
       c = build_omp_clause (UNKNOWN_LOCATION, OMP_CLAUSE__SIMDUID_);
       OMP_CLAUSE__SIMDUID__DECL (c) = uid;
       OMP_CLAUSE_CHAIN (c) = gimple_omp_for_clauses (ctx->stmt);
       gimple_omp_for_set_clauses (ctx->stmt, c);
-      g = gimple_build_assign_with_ops (INTEGER_CST, lane,
-					build_int_cst (unsigned_type_node, 0),
-					NULL_TREE);
+      gimple g =
+	gimple_build_assign_with_ops (INTEGER_CST, lane,
+				      build_int_cst (unsigned_type_node, 0),
+				      NULL_TREE);
       gimple_seq_add_stmt (ilist, g);
       for (int i = 0; i < 2; i++)
 	if (llist[i])
 	  {
 	    tree vf = create_tmp_var (unsigned_type_node, NULL);
-	    g = gimple_build_call_internal (IFN_GOMP_SIMD_VF, 1, uid);
-	    gimple_call_set_lhs (g, vf);
+	    call = gimple_build_call_internal (IFN_GOMP_SIMD_VF, 1, uid);
+	    gimple_call_set_lhs (call, vf);
 	    gimple_seq *seq = i == 0 ? ilist : dlist;
-	    gimple_seq_add_stmt (seq, g);
+	    gimple_seq_add_stmt (seq, call);
 	    tree t = build_int_cst (unsigned_type_node, 0);
 	    g = gimple_build_assign_with_ops (INTEGER_CST, idx, t, NULL_TREE);
 	    gimple_seq_add_stmt (seq, g);
@@ -3693,7 +3694,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
 		  if (lastlane == NULL)
 		    {
 		      lastlane = create_tmp_var (unsigned_type_node, NULL);
-		      gimple g
+		      gimple_call g
 			= gimple_build_call_internal (IFN_GOMP_SIMD_LAST_LANE,
 						      2, simduid,
 						      TREE_OPERAND (val, 1));
@@ -5544,10 +5545,10 @@ expand_omp_for_generic (struct omp_region *region,
     t = builtin_decl_explicit (BUILT_IN_GOMP_LOOP_END_CANCEL);
   else
     t = builtin_decl_explicit (BUILT_IN_GOMP_LOOP_END);
-  stmt = gimple_build_call (t, 0);
+  gimple_call call = gimple_build_call (t, 0);
   if (gimple_omp_return_lhs (gsi_stmt (gsi)))
-    gimple_call_set_lhs (stmt, gimple_omp_return_lhs (gsi_stmt (gsi)));
-  gsi_insert_after (&gsi, stmt, GSI_SAME_STMT);
+    gimple_call_set_lhs (call, gimple_omp_return_lhs (gsi_stmt (gsi)));
+  gsi_insert_after (&gsi, call, GSI_SAME_STMT);
   gsi_remove (&gsi, true);
 
   /* Connect the new blocks.  */
@@ -6867,6 +6868,7 @@ expand_omp_sections (struct omp_region *region)
   basic_block entry_bb, l0_bb, l1_bb, l2_bb, default_bb;
   gimple_stmt_iterator si, switch_si;
   gimple sections_stmt, stmt, cont;
+  gimple_call call;
   edge_iterator ei;
   edge e;
   struct omp_region *inner;
@@ -6929,16 +6931,16 @@ expand_omp_sections (struct omp_region *region)
 	 call GOMP_sections_start.  */
       t = build_int_cst (unsigned_type_node, len - 1);
       u = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_START);
-      stmt = gimple_build_call (u, 1, t);
+      call = gimple_build_call (u, 1, t);
     }
   else
     {
       /* Otherwise, call GOMP_sections_next.  */
       u = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_NEXT);
-      stmt = gimple_build_call (u, 0);
+      call = gimple_build_call (u, 0);
     }
-  gimple_call_set_lhs (stmt, vin);
-  gsi_insert_after (&si, stmt, GSI_SAME_STMT);
+  gimple_call_set_lhs (call, vin);
+  gsi_insert_after (&si, call, GSI_SAME_STMT);
   gsi_remove (&si, true);
 
   /* The switch() statement replacing GIMPLE_OMP_SECTIONS_SWITCH goes in
@@ -7026,9 +7028,9 @@ expand_omp_sections (struct omp_region *region)
       gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_CONTINUE);
 
       bfn_decl = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_NEXT);
-      stmt = gimple_build_call (bfn_decl, 0);
-      gimple_call_set_lhs (stmt, vnext);
-      gsi_insert_after (&si, stmt, GSI_SAME_STMT);
+      call = gimple_build_call (bfn_decl, 0);
+      gimple_call_set_lhs (call, vnext);
+      gsi_insert_after (&si, call, GSI_SAME_STMT);
       gsi_remove (&si, true);
 
       single_succ_edge (l1_bb)->flags = EDGE_FALLTHRU;
@@ -7042,10 +7044,10 @@ expand_omp_sections (struct omp_region *region)
     t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END_CANCEL);
   else
     t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END);
-  stmt = gimple_build_call (t, 0);
+  call = gimple_build_call (t, 0);
   if (gimple_omp_return_lhs (gsi_stmt (si)))
-    gimple_call_set_lhs (stmt, gimple_omp_return_lhs (gsi_stmt (si)));
-  gsi_insert_after (&si, stmt, GSI_SAME_STMT);
+    gimple_call_set_lhs (call, gimple_omp_return_lhs (gsi_stmt (si)));
+  gsi_insert_after (&si, call, GSI_SAME_STMT);
   gsi_remove (&si, true);
 
   set_immediate_dominator (CDI_DOMINATORS, default_bb, l0_bb);
@@ -8413,7 +8415,8 @@ lower_omp_single_simple (gimple single_stmt, gimple_seq *pre_p)
   location_t loc = gimple_location (single_stmt);
   tree tlabel = create_artificial_label (loc);
   tree flabel = create_artificial_label (loc);
-  gimple call, cond;
+  gimple_call call;
+  gimple cond;
   tree lhs, decl;
 
   decl = builtin_decl_explicit (BUILT_IN_GOMP_SINGLE_START);
@@ -9863,6 +9866,7 @@ static void
 lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
   gimple stmt = gsi_stmt (*gsi_p);
+  gimple_call call;
   struct walk_stmt_info wi;
 
   if (gimple_has_location (stmt))
@@ -9971,6 +9975,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
       break;
     case GIMPLE_CALL:
       tree fndecl;
+      call = static_cast<gimple_call> (stmt);
       fndecl = gimple_call_fndecl (stmt);
       if (fndecl
 	  && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
@@ -10005,7 +10010,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		gimple_call_set_fndecl (stmt, fndecl);
 		gimple_call_set_fntype (stmt, TREE_TYPE (fndecl));
 	      }
-	    gimple_call_set_lhs (stmt, lhs);
+	    gimple_call_set_lhs (call, lhs);
 	    tree fallthru_label;
 	    fallthru_label = create_artificial_label (UNKNOWN_LOCATION);
 	    gimple g;
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index d74455d2..0358b26 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -1614,11 +1614,12 @@ lower_transaction (gimple_stmt_iterator *gsi, struct walk_stmt_info *wi)
       n_seq = gimple_seq_alloc_with_stmt (g);
       e_seq = NULL;
 
-      g = gimple_build_call (builtin_decl_explicit (BUILT_IN_EH_POINTER),
-			     1, integer_zero_node);
+      gimple_call call =
+	gimple_build_call (builtin_decl_explicit (BUILT_IN_EH_POINTER),
+			   1, integer_zero_node);
       ptr = create_tmp_var (ptr_type_node, NULL);
-      gimple_call_set_lhs (g, ptr);
-      gimple_seq_add_stmt (&e_seq, g);
+      gimple_call_set_lhs (call, ptr);
+      gimple_seq_add_stmt (&e_seq, call);
 
       g = gimple_build_call (builtin_decl_explicit (BUILT_IN_TM_COMMIT_EH),
 			     1, ptr);
@@ -2065,12 +2066,12 @@ transaction_subcode_ior (struct tm_region *region, unsigned flags)
 
    LOC is the location to use for the new statement(s).  */
 
-static gimple
+static gimple_call
 build_tm_load (location_t loc, tree lhs, tree rhs, gimple_stmt_iterator *gsi)
 {
   enum built_in_function code = END_BUILTINS;
   tree t, type = TREE_TYPE (rhs), decl;
-  gimple gcall;
+  gimple_call gcall;
 
   if (type == float_type_node)
     code = BUILT_IN_TM_LOAD_FLOAT;
@@ -2310,6 +2311,7 @@ expand_call_tm (struct tm_region *region,
 		gimple_stmt_iterator *gsi)
 {
   gimple stmt = gsi_stmt (*gsi);
+  gimple_call call_stmt = as_a<gimple_statement_call> (stmt);
   tree lhs = gimple_call_lhs (stmt);
   tree fn_decl;
   struct cgraph_node *node;
@@ -2412,7 +2414,7 @@ expand_call_tm (struct tm_region *region,
 	      }
 	}
 
-      gimple_call_set_lhs (stmt, tmp);
+      gimple_call_set_lhs (call_stmt, tmp);
       update_stmt (stmt);
       stmt = gimple_build_assign (lhs, tmp);
       gimple_set_location (stmt, loc);
@@ -2698,7 +2700,7 @@ expand_transaction (struct tm_region *region, void *data ATTRIBUTE_UNUSED)
     if (subcode & GTMA_IS_OUTER)
       region->original_transaction_was_outer = true;
     tree t = build_int_cst (tm_state_type, flags);
-    gimple call = gimple_build_call (tm_start, 1, t);
+    gimple_call call = gimple_build_call (tm_start, 1, t);
     gimple_call_set_lhs (call, tm_state);
     gimple_set_location (call, gimple_location (region->transaction_stmt));
 
@@ -4930,7 +4932,7 @@ ipa_tm_insert_irr_call (struct cgraph_node *node, struct tm_region *region,
 			basic_block bb)
 {
   gimple_stmt_iterator gsi;
-  gimple g;
+  gimple_call g;
 
   transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
 
@@ -4954,10 +4956,11 @@ ipa_tm_insert_irr_call (struct cgraph_node *node, struct tm_region *region,
 static bool
 ipa_tm_insert_gettmclone_call (struct cgraph_node *node,
 			       struct tm_region *region,
-			       gimple_stmt_iterator *gsi, gimple stmt)
+			       gimple_stmt_iterator *gsi, gimple_call stmt)
 {
   tree gettm_fn, ret, old_fn, callfn;
-  gimple g, g2;
+  gimple_call g;
+  gimple g2;
   bool safe;
 
   old_fn = gimple_call_fn (stmt);
@@ -5050,7 +5053,7 @@ ipa_tm_transform_calls_redirect (struct cgraph_node *node,
 				 gimple_stmt_iterator *gsi,
 				 bool *need_ssa_rename_p)
 {
-  gimple stmt = gsi_stmt (*gsi);
+  gimple_call stmt = as_a<gimple_statement_call> (gsi_stmt (*gsi));
   struct cgraph_node *new_node;
   struct cgraph_edge *e = cgraph_edge (node, stmt);
   tree fndecl = gimple_call_fndecl (stmt);
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index d705657..8d82342 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -8262,6 +8262,7 @@ execute_fixup_cfg (void)
 		      : NULL;
 	  if (decl)
 	    {
+	      gimple_call call = static_cast<gimple_call> (stmt);
 	      int flags = gimple_call_flags (stmt);
 	      if (flags & (ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE))
 		{
@@ -8276,7 +8277,7 @@ execute_fixup_cfg (void)
 		}
 
 	      if (flags & ECF_NORETURN
-		  && fixup_noreturn_call (stmt))
+		  && fixup_noreturn_call (call))
 		todo |= TODO_cleanup_cfg;
 	     }
 
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index c627d2c..3cd625c 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -499,7 +499,7 @@ remove_forwarder_block (basic_block bb)
    and remove LHS.  Return true if something changed.  */
 
 bool
-fixup_noreturn_call (gimple stmt)
+fixup_noreturn_call (gimple_call stmt)
 {
   basic_block bb = gimple_bb (stmt);
   bool changed = false;
@@ -582,7 +582,7 @@ split_bbs_on_noreturn_calls (void)
 	    || !gimple_call_noreturn_p (stmt))
 	  continue;
 
-	changed |= fixup_noreturn_call (stmt);
+	changed |= fixup_noreturn_call (static_cast<gimple_call> (stmt));
       }
 
   return changed;
diff --git a/gcc/tree-cfgcleanup.h b/gcc/tree-cfgcleanup.h
index 6bd3c39..b7e0dde 100644
--- a/gcc/tree-cfgcleanup.h
+++ b/gcc/tree-cfgcleanup.h
@@ -23,6 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 /* In tree-cfgcleanup.c  */
 extern bitmap cfgcleanup_altered_bbs;
 extern bool cleanup_tree_cfg (void);
-extern bool fixup_noreturn_call (gimple stmt);
+extern bool fixup_noreturn_call (gimple_call stmt);
 
 #endif /* GCC_TREE_CFGCLEANUP_H */
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 6439402..aee1e26 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -936,7 +936,8 @@ expand_complex_libcall (gimple_stmt_iterator *gsi, tree ar, tree ai,
   enum machine_mode mode;
   enum built_in_function bcode;
   tree fn, type, lhs;
-  gimple old_stmt, stmt;
+  gimple old_stmt;
+  gimple_call stmt;
 
   old_stmt = gsi_stmt (*gsi);
   lhs = gimple_assign_lhs (old_stmt);
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index a91542d..3347b7b 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3204,11 +3204,11 @@ lower_resx (basic_block bb, gimple stmt, struct pointer_map_t *mnt_map)
 	{
 	  fn = builtin_decl_implicit (BUILT_IN_EH_POINTER);
 	  src_nr = build_int_cst (integer_type_node, src_r->index);
-	  x = gimple_build_call (fn, 1, src_nr);
+	  gimple_call call = gimple_build_call (fn, 1, src_nr);
 	  var = create_tmp_var (ptr_type_node, NULL);
-	  var = make_ssa_name (var, x);
-	  gimple_call_set_lhs (x, var);
-	  gsi_insert_before (&gsi, x, GSI_SAME_STMT);
+	  var = make_ssa_name (var, call);
+	  gimple_call_set_lhs (call, var);
+	  gsi_insert_before (&gsi, call, GSI_SAME_STMT);
 
 	  fn = builtin_decl_implicit (BUILT_IN_UNWIND_RESUME);
 	  x = gimple_build_call (fn, 1, var);
@@ -3578,12 +3578,13 @@ lower_eh_dispatch (basic_block src, gimple stmt)
 	else
 	  {
 	    fn = builtin_decl_implicit (BUILT_IN_EH_FILTER);
-	    x = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
-							 region_nr));
+	    gimple_call call =
+	      gimple_build_call (fn, 1, build_int_cst (integer_type_node,
+						       region_nr));
 	    filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
-	    filter = make_ssa_name (filter, x);
-	    gimple_call_set_lhs (x, filter);
-	    gsi_insert_before (&gsi, x, GSI_SAME_STMT);
+	    filter = make_ssa_name (filter, call);
+	    gimple_call_set_lhs (call, filter);
+	    gsi_insert_before (&gsi, call, GSI_SAME_STMT);
 
 	    /* Turn the default label into a default case.  */
 	    default_label = build_case_label (NULL, NULL, default_label);
@@ -3604,12 +3605,13 @@ lower_eh_dispatch (basic_block src, gimple stmt)
 	edge f_e = FALLTHRU_EDGE (src);
 
 	fn = builtin_decl_implicit (BUILT_IN_EH_FILTER);
-	x = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
+	gimple_call call
+	  = gimple_build_call (fn, 1, build_int_cst (integer_type_node,
 						     region_nr));
 	filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
-	filter = make_ssa_name (filter, x);
-	gimple_call_set_lhs (x, filter);
-	gsi_insert_before (&gsi, x, GSI_SAME_STMT);
+	filter = make_ssa_name (filter, call);
+	gimple_call_set_lhs (call, filter);
+	gsi_insert_before (&gsi, call, GSI_SAME_STMT);
 
 	r->u.allowed.label = NULL;
 	x = gimple_build_cond (EQ_EXPR, filter,
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index b5ca407..7b17a68 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -427,7 +427,7 @@ gen_emutls_addr (tree decl, struct lower_emutls_data *d)
     {
       struct varpool_node *cvar;
       tree cdecl;
-      gimple x;
+      gimple_call x;
 
       cvar = control_vars[index];
       cdecl = cvar->decl;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a600d3c..83a3e27 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1648,7 +1648,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 	      /* __builtin_va_arg_pack () should be replaced by
 		 all arguments corresponding to ... in the caller.  */
 	      tree p;
-	      gimple new_call;
+	      gimple_call new_call;
 	      vec<tree> argarray;
 	      size_t nargs = gimple_call_num_args (id->gimple_call);
 	      size_t n;
@@ -1725,7 +1725,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 
 	  /* We're duplicating a CALL_EXPR.  Find any corresponding
 	     callgraph edges and update or duplicate them.  */
-	  if (is_gimple_call (stmt))
+	  if (gimple_call call_stmt = dyn_cast<gimple_statement_call> (stmt))
 	    {
 	      struct cgraph_edge *edge;
 	      int flags;
@@ -1739,7 +1739,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 		      int edge_freq = edge->frequency;
 		      int new_freq;
 		      struct cgraph_edge *old_edge = edge;
-		      edge = cgraph_clone_edge (edge, id->dst_node, stmt,
+		      edge = cgraph_clone_edge (edge, id->dst_node, call_stmt,
 					        gimple_uid (stmt),
 					        REG_BR_PROB_BASE, CGRAPH_FREQ_BASE,
 					        true);
@@ -1758,7 +1758,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 
 			  gcc_assert (!edge->indirect_unknown_callee);
 			  cgraph_speculative_call_info (old_edge, direct, indirect, ref);
-			  indirect = cgraph_clone_edge (indirect, id->dst_node, stmt,
+			  indirect = cgraph_clone_edge (indirect, id->dst_node, call_stmt,
 							gimple_uid (stmt),
 							REG_BR_PROB_BASE, CGRAPH_FREQ_BASE,
 							true);
@@ -1797,14 +1797,14 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 
 		case CB_CGE_MOVE_CLONES:
 		  cgraph_set_call_stmt_including_clones (id->dst_node,
-							 orig_stmt, stmt);
+							 orig_stmt, call_stmt);
 		  edge = cgraph_edge (id->dst_node, stmt);
 		  break;
 
 		case CB_CGE_MOVE:
 		  edge = cgraph_edge (id->dst_node, orig_stmt);
 		  if (edge)
-		    cgraph_set_call_stmt (edge, stmt);
+		    cgraph_set_call_stmt (edge, call_stmt);
 		  break;
 
 		default:
@@ -1833,12 +1833,12 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 			      || !id->dst_node->definition);
 		  if (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES)
 		    cgraph_create_edge_including_clones
-		      (id->dst_node, dest, orig_stmt, stmt, bb->count,
+		      (id->dst_node, dest, orig_stmt, call_stmt, bb->count,
 		       compute_call_stmt_bb_frequency (id->dst_node->decl,
 		       				       copy_basic_block),
 		       CIF_ORIGINALLY_INDIRECT_CALL);
 		  else
-		    cgraph_create_edge (id->dst_node, dest, stmt,
+		    cgraph_create_edge (id->dst_node, dest, call_stmt,
 					bb->count,
 					compute_call_stmt_bb_frequency
 					  (id->dst_node->decl,
@@ -4401,7 +4401,7 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
 		  gsi_prev (&i2);
 		  if (fold_stmt (&gsi))
 		    {
-		      gimple new_stmt;
+		      gimple_call new_stmt;
 		      /* If a builtin at the end of a bb folded into nothing,
 			 the following loop won't work.  */
 		      if (gsi_end_p (gsi))
@@ -4416,7 +4416,7 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
 			gsi_next (&i2);
 		      while (1)
 			{
-			  new_stmt = gsi_stmt (i2);
+			  new_stmt = as_a<gimple_statement_call> (gsi_stmt (i2));
 			  update_stmt (new_stmt);
 			  cgraph_update_edges_for_call_stmt (old_stmt, old_decl,
 							     new_stmt);
@@ -4451,8 +4451,14 @@ fold_marked_statements (int first, struct pointer_set_t *statements)
 
 		  if (is_gimple_call (old_stmt)
 		      || is_gimple_call (new_stmt))
-		    cgraph_update_edges_for_call_stmt (old_stmt, old_decl,
-						       new_stmt);
+		    {
+		      if (new_stmt)
+			gcc_assert (new_stmt->code == GIMPLE_CALL);
+		      gimple_call new_call_stmt =
+			static_cast<gimple_call> (new_stmt);
+		      cgraph_update_edges_for_call_stmt (old_stmt, old_decl,
+							 new_call_stmt);
+		    }
 
 		  if (maybe_clean_or_replace_eh_stmt (old_stmt, new_stmt))
 		    gimple_purge_dead_eh_edges (BASIC_BLOCK (first));
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index dc63ef6..5f5dcef 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -401,7 +401,7 @@ get_chain_field (struct nesting_info *info)
 
 static tree
 init_tmp_var_with_call (struct nesting_info *info, gimple_stmt_iterator *gsi,
-		        gimple call)
+		        gimple_call call)
 {
   tree t;
 
@@ -1919,7 +1919,7 @@ convert_tramp_reference_op (tree *tp, int *walk_subtrees, void *data)
   struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
   struct nesting_info *const info = (struct nesting_info *) wi->info, *i;
   tree t = *tp, decl, target_context, x, builtin;
-  gimple call;
+  gimple_call call;
 
   *walk_subtrees = 0;
   switch (TREE_CODE (t))
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 38da577..35c97b6 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4476,7 +4476,7 @@ replace_removed_params_ssa_names (gimple stmt,
   if (is_gimple_assign (stmt))
     gimple_assign_set_lhs (stmt, name);
   else if (is_gimple_call (stmt))
-    gimple_call_set_lhs (stmt, name);
+    gimple_call_set_lhs (static_cast<gimple_call> (stmt), name);
   else
     gimple_phi_set_result (stmt, name);
 
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 72e2fb8..3527848 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1212,6 +1212,7 @@ eliminate_unnecessary_stmts (void)
 	    }
 	  else if (is_gimple_call (stmt))
 	    {
+	      gimple_call call_stmt = static_cast <gimple_call> (stmt);
 	      tree name = gimple_call_lhs (stmt);
 
 	      notice_special_calls (stmt);
@@ -1240,7 +1241,7 @@ eliminate_unnecessary_stmts (void)
 		      fprintf (dump_file, "\n");
 		    }
 
-		  gimple_call_set_lhs (stmt, NULL_TREE);
+		  gimple_call_set_lhs (call_stmt, NULL_TREE);
 		  maybe_clean_or_replace_eh_stmt (stmt, stmt);
 		  update_stmt (stmt);
 		  release_ssa_name (name);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 93b8970..c0415d4 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1651,8 +1651,9 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
 	    {
 	      /* If STMT1 is a mem{,p}cpy call, adjust it and remove
 		 memset call.  */
+	      gimple_call call_stmt1 = static_cast <gimple_call> (stmt1);
 	      if (lhs1 && DECL_FUNCTION_CODE (callee1) == BUILT_IN_MEMPCPY)
-		gimple_call_set_lhs (stmt1, NULL_TREE);
+		gimple_call_set_lhs (call_stmt1, NULL_TREE);
 	      gimple_call_set_arg (stmt1, 1, new_str_cst);
 	      gimple_call_set_arg (stmt1, 2,
 				   build_int_cst (TREE_TYPE (len1), src_len));
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 9a29411..6253c3d 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -724,6 +724,7 @@ execute_cse_sincos_1 (tree name)
   imm_use_iterator use_iter;
   tree fndecl, res, type;
   gimple def_stmt, use_stmt, stmt;
+  gimple_call call_stmt;
   int seen_cos = 0, seen_sin = 0, seen_cexpi = 0;
   vec<gimple> stmts = vNULL;
   basic_block top_bb = NULL;
@@ -768,9 +769,9 @@ 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)
@@ -778,12 +779,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++;
 
@@ -1944,7 +1945,7 @@ execute_optimize_bswap (void)
 	  tree bswap_tmp;
 	  tree fndecl = NULL_TREE;
 	  int type_size;
-	  gimple call;
+	  gimple_call call;
 
 	  if (!is_gimple_assign (stmt)
 	      || gimple_assign_rhs_code (stmt) != BIT_IOR_EXPR)
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index d5bcc9c..4565de0 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -697,7 +697,7 @@ move_ssa_defining_stmt_for_defs (gimple new_stmt, gimple old_stmt)
    A GIMPLE_CALL STMT is being replaced with GIMPLE_CALL NEW_STMT.  */
 
 static void
-finish_update_gimple_call (gimple_stmt_iterator *si_p, gimple new_stmt,
+finish_update_gimple_call (gimple_stmt_iterator *si_p, gimple_call new_stmt,
 			   gimple stmt)
 {
   gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
@@ -718,7 +718,8 @@ 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;
+  gimple stmt = gsi_stmt (*si_p);
 
   gcc_assert (is_gimple_call (stmt));
   va_start (ap, nargs);
@@ -752,7 +753,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)
         {
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 39982f1..982c6d2 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -3979,7 +3979,8 @@ attempt_builtin_powi (gimple stmt, vec<operand_entry_t> *ops)
   tree type = TREE_TYPE (gimple_get_lhs (stmt));
   tree powi_fndecl = mathfn_built_in (type, BUILT_IN_POWI);
   gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
-  gimple mul_stmt, pow_stmt;
+  gimple mul_stmt;
+  gimple_call pow_stmt;
 
   /* Nothing to do if BUILT_IN_POWI doesn't exist for this type and
      target.  */
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index ea73179..ad18fc1 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -412,12 +412,15 @@ get_string_length (strinfo si)
 
   if (si->stmt)
     {
-      gimple stmt = si->stmt, lenstmt;
+      gimple stmt = si->stmt;
+      gimple_call lenstmt_call;
+      gimple lenstmt_assign;
       tree callee, lhs, fn, tem;
       location_t loc;
       gimple_stmt_iterator gsi;
 
       gcc_assert (is_gimple_call (stmt));
+      gimple_call call_stmt = static_cast<gimple_call> (stmt);
       callee = gimple_call_fndecl (stmt);
       gcc_assert (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL);
       lhs = gimple_call_lhs (stmt);
@@ -436,11 +439,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);
+	  lenstmt_call = gimple_build_call (fn, 1, tem);
+	  lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), lenstmt_call);
+	  gimple_call_set_lhs (lenstmt_call, lhs);
+	  gimple_set_vuse (lenstmt_call, gimple_vuse (stmt));
+	  gsi_insert_before (&gsi, lenstmt_call, GSI_SAME_STMT);
 	  tem = gimple_call_arg (stmt, 0);
           if (!ptrofftype_p (TREE_TYPE (lhs)))
             {
@@ -448,13 +451,13 @@ get_string_length (strinfo si)
               lhs = force_gimple_operand_gsi (&gsi, lhs, true, NULL_TREE,
                                               true, GSI_SAME_STMT);
             }
-	  lenstmt
+	  lenstmt_assign
 	    = 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, lenstmt_assign, GSI_SAME_STMT);
+	  gimple_call_set_arg (stmt, 0, gimple_assign_lhs (lenstmt_assign));
 	  lhs = NULL_TREE;
 	  /* FALLTHRU */
 	case BUILT_IN_STRCPY:
@@ -471,7 +474,7 @@ get_string_length (strinfo si)
 	    }
 	  gimple_call_set_fndecl (stmt, fn);
 	  lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), stmt);
-	  gimple_call_set_lhs (stmt, lhs);
+	  gimple_call_set_lhs (call_stmt, lhs);
 	  update_stmt (stmt);
 	  if (dump_file && (dump_flags & TDF_DETAILS) != 0)
 	    {
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index fb3fe94..2ddaebe 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4463,24 +4463,24 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
 	}
 
       builtin_decl = targetm.vectorize.builtin_mask_for_load ();
-      new_stmt = gimple_build_call (builtin_decl, 1, init_addr);
+      gimple_call call_stmt = gimple_build_call (builtin_decl, 1, init_addr);
       vec_dest =
 	vect_create_destination_var (scalar_dest,
-				     gimple_call_return_type (new_stmt));
-      new_temp = make_ssa_name (vec_dest, new_stmt);
-      gimple_call_set_lhs (new_stmt, new_temp);
+				     gimple_call_return_type (call_stmt));
+      new_temp = make_ssa_name (vec_dest, call_stmt);
+      gimple_call_set_lhs (call_stmt, new_temp);
 
       if (compute_in_loop)
-	gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
+	gsi_insert_before (gsi, call_stmt, GSI_SAME_STMT);
       else
 	{
 	  /* Generate the misalignment computation outside LOOP.  */
 	  pe = loop_preheader_edge (loop);
-	  new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);
+	  new_bb = gsi_insert_on_edge_immediate (pe, call_stmt);
 	  gcc_assert (!new_bb);
 	}
 
-      *realignment_token = gimple_call_lhs (new_stmt);
+      *realignment_token = gimple_call_lhs (call_stmt);
 
       /* The result of the CALL_EXPR to this builtin is determined from
          the value of the parameter and no global variables are touched
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 8d9aaa2..2dc918f 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -801,7 +801,7 @@ vect_recog_pow_pattern (vec<gimple> *stmts, tree *type_in,
       *type_in = get_vectype_for_scalar_type (TREE_TYPE (base));
       if (*type_in)
 	{
-	  gimple stmt = gimple_build_call (newfn, 1, base);
+	  gimple_call stmt = gimple_build_call (newfn, 1, base);
 	  if (vectorizable_function (stmt, *type_in, *type_in)
 	      != NULL_TREE)
 	    {
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 9516e76..906a44d 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1940,9 +1940,10 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 		      vec<tree> vec_oprndsk = vec_defs[k];
 		      vargs[k] = vec_oprndsk[i];
 		    }
-		  new_stmt = gimple_build_call_vec (fndecl, vargs);
+		  gimple_call call = gimple_build_call_vec (fndecl, vargs);
+		  new_stmt = call;
 		  new_temp = make_ssa_name (vec_dest, new_stmt);
-		  gimple_call_set_lhs (new_stmt, new_temp);
+		  gimple_call_set_lhs (call, new_temp);
 		  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 		  SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
 		}
@@ -1992,9 +1993,10 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	    }
 	  else
 	    {
-	      new_stmt = gimple_build_call_vec (fndecl, vargs);
+	      gimple_call call = gimple_build_call_vec (fndecl, vargs);
+	      new_stmt = call;
 	      new_temp = make_ssa_name (vec_dest, new_stmt);
-	      gimple_call_set_lhs (new_stmt, new_temp);
+	      gimple_call_set_lhs (call, new_temp);
 	    }
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 
@@ -2039,9 +2041,10 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 		      vargs.quick_push (vec_oprndsk[i]);
 		      vargs.quick_push (vec_oprndsk[i + 1]);
 		    }
-		  new_stmt = gimple_build_call_vec (fndecl, vargs);
+		  gimple_call call = gimple_build_call_vec (fndecl, vargs);
+		  new_stmt = call;
 		  new_temp = make_ssa_name (vec_dest, new_stmt);
-		  gimple_call_set_lhs (new_stmt, new_temp);
+		  gimple_call_set_lhs (call, new_temp);
 		  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 		  SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
 		}
@@ -2078,9 +2081,10 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	      vargs.quick_push (vec_oprnd1);
 	    }
 
-	  new_stmt = gimple_build_call_vec (fndecl, vargs);
+	  gimple_call call = gimple_build_call_vec (fndecl, vargs);
+	  new_stmt = call;
 	  new_temp = make_ssa_name (vec_dest, new_stmt);
-	  gimple_call_set_lhs (new_stmt, new_temp);
+	  gimple_call_set_lhs (call, new_temp);
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 
 	  if (j == 0)
@@ -2152,13 +2156,15 @@ vect_gen_widened_results_half (enum tree_code code,
   /* Generate half of the widened result:  */
   if (code == CALL_EXPR)
     {
+      gimple_call call;
       /* Target specific support  */
       if (op_type == binary_op)
-	new_stmt = gimple_build_call (decl, 2, vec_oprnd0, vec_oprnd1);
+	call = gimple_build_call (decl, 2, vec_oprnd0, vec_oprnd1);
       else
-	new_stmt = gimple_build_call (decl, 1, vec_oprnd0);
+	call = gimple_build_call (decl, 1, vec_oprnd0);
+      new_stmt = call;
       new_temp = make_ssa_name (vec_dest, new_stmt);
-      gimple_call_set_lhs (new_stmt, new_temp);
+      gimple_call_set_lhs (call, new_temp);
     }
   else
     {
@@ -2710,9 +2716,10 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
 	      /* Arguments are ready, create the new vector stmt.  */
 	      if (code1 == CALL_EXPR)
 		{
-		  new_stmt = gimple_build_call (decl1, 1, vop0);
+		  gimple_call call = gimple_build_call (decl1, 1, vop0);
+		  new_stmt = call;
 		  new_temp = make_ssa_name (vec_dest, new_stmt);
-		  gimple_call_set_lhs (new_stmt, new_temp);
+		  gimple_call_set_lhs (call, new_temp);
 		}
 	      else
 		{
@@ -2821,9 +2828,10 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
 		{
 		  if (codecvt1 == CALL_EXPR)
 		    {
-		      new_stmt = gimple_build_call (decl1, 1, vop0);
+		      gimple_call call = gimple_build_call (decl1, 1, vop0);
+		      new_stmt = call;
 		      new_temp = make_ssa_name (vec_dest, new_stmt);
-		      gimple_call_set_lhs (new_stmt, new_temp);
+		      gimple_call_set_lhs (call, new_temp);
 		    }
 		  else
 		    {
@@ -2879,9 +2887,10 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
 	      {
 		if (codecvt1 == CALL_EXPR)
 		  {
-		    new_stmt = gimple_build_call (decl1, 1, vop0);
+		    gimple_call call = gimple_build_call (decl1, 1, vop0);
+		    new_stmt = call;
 		    new_temp = make_ssa_name (vec_dest, new_stmt);
-		    gimple_call_set_lhs (new_stmt, new_temp);
+		    gimple_call_set_lhs (call, new_temp);
 		  }
 		else
 		  {
@@ -4240,8 +4249,9 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  /* Emit:
 	       MEM_REF[...all elements...] = STORE_LANES (VEC_ARRAY).  */
 	  data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
-	  new_stmt = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array);
-	  gimple_call_set_lhs (new_stmt, data_ref);
+	  gimple_call call = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array);
+	  new_stmt = call;
+	  gimple_call_set_lhs (call, data_ref);
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 	}
       else
@@ -4732,8 +4742,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	      op = var;
 	    }
 
-	  new_stmt
+	  gimple_call call
 	    = gimple_build_call (gather_decl, 5, mask, ptr, op, mask, scale);
+	  new_stmt = call;
 
 	  if (!useless_type_conversion_p (vectype, rettype))
 	    {
@@ -4741,7 +4752,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 			  == TYPE_VECTOR_SUBPARTS (rettype));
 	      var = vect_get_new_vect_var (rettype, vect_simple_var, NULL);
 	      op = make_ssa_name (var, new_stmt);
-	      gimple_call_set_lhs (new_stmt, op);
+	      gimple_call_set_lhs (call, op);
 	      vect_finish_stmt_generation (stmt, new_stmt, gsi);
 	      var = make_ssa_name (vec_dest, NULL);
 	      op = build1 (VIEW_CONVERT_EXPR, vectype, op);
@@ -4752,7 +4763,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  else
 	    {
 	      var = make_ssa_name (vec_dest, new_stmt);
-	      gimple_call_set_lhs (new_stmt, var);
+	      gimple_call_set_lhs (call, var);
 	    }
 
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
@@ -5111,8 +5122,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  /* Emit:
 	       VEC_ARRAY = LOAD_LANES (MEM_REF[...all elements...]).  */
 	  data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
-	  new_stmt = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref);
-	  gimple_call_set_lhs (new_stmt, vec_array);
+	  gimple_call call = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref);
+	  new_stmt = call;
+	  gimple_call_set_lhs (call, vec_array);
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 
 	  /* Extract each vector into an SSA_NAME.  */
diff --git a/gcc/tsan.c b/gcc/tsan.c
index bceb597..de95625 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -426,7 +426,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);
+  gimple 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;
@@ -487,7 +488,8 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
 		    gsi_insert_after (gsi, g, GSI_NEW_STMT);
 		    args[1] = var;
 		  }
-		gimple_call_set_lhs (stmt,
+		gimple_call call_stmt = as_a<gimple_statement_call> (stmt);
+		gimple_call_set_lhs (call_stmt,
 				     make_ssa_name (TREE_TYPE (lhs), NULL));
 		/* BIT_NOT_EXPR stands for NAND.  */
 		if (tsan_atomic_table[i].code == BIT_NOT_EXPR)
@@ -569,7 +571,8 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
 		g = gimple_build_assign_with_ops (COND_EXPR, lhs, cond,
 						  args[1],
 						  gimple_assign_lhs (g));
-		gimple_call_set_lhs (stmt, t);
+		gimple_call call_stmt = as_a<gimple_statement_call> (stmt);
+		gimple_call_set_lhs (call_stmt, t);
 		update_stmt (stmt);
 		gsi_insert_after (gsi, g, GSI_NEW_STMT);
 	      }
@@ -649,7 +652,7 @@ instrument_func_entry (void)
   basic_block succ_bb;
   gimple_stmt_iterator gsi;
   tree ret_addr, builtin_decl;
-  gimple g;
+  gimple_call g;
 
   succ_bb = single_succ (ENTRY_BLOCK_PTR);
   gsi = gsi_after_labels (succ_bb);
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 7be54ce..7ca9f4d 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1292,11 +1292,12 @@ check_ic_target (gimple call_stmt, struct cgraph_node *target)
     old call
  */
 
-gimple
-gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
+gimple_call
+gimple_ic (gimple_call icall_stmt, struct cgraph_node *direct_call,
 	   int prob, gcov_type count, gcov_type all)
 {
-  gimple dcall_stmt, load_stmt, cond_stmt;
+  gimple_call dcall_stmt;
+  gimple load_stmt, 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);
@@ -1327,7 +1328,7 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
   gimple_set_vdef (icall_stmt, NULL_TREE);
   gimple_set_vuse (icall_stmt, NULL_TREE);
   update_stmt (icall_stmt);
-  dcall_stmt = gimple_copy (icall_stmt);
+  dcall_stmt = static_cast<gimple_call> (gimple_copy (icall_stmt));
   gimple_call_set_fndecl (dcall_stmt, direct_call->decl);
   dflags = flags_from_decl_or_type (direct_call->decl);
   if ((dflags & ECF_NORETURN) != 0)
@@ -1559,10 +1560,11 @@ interesting_stringop_to_profile_p (tree fndecl, gimple call, int *size_arg)
    assuming we'll propagate a true constant into ICALL_SIZE later.  */
 
 static void
-gimple_stringop_fixed_value (gimple vcall_stmt, tree icall_size, int prob,
+gimple_stringop_fixed_value (gimple_call vcall_stmt, tree icall_size, int prob,
 			     gcov_type count, gcov_type all)
 {
-  gimple tmp_stmt, cond_stmt, icall_stmt;
+  gimple tmp_stmt, cond_stmt;
+  gimple_call icall_stmt;
   tree tmp0, tmp1, vcall_size, optype;
   basic_block cond_bb, icall_bb, vcall_bb, join_bb;
   edge e_ci, e_cv, e_iv, e_ij, e_vj;
@@ -1594,7 +1596,7 @@ gimple_stringop_fixed_value (gimple vcall_stmt, tree icall_size, int prob,
   gimple_set_vdef (vcall_stmt, NULL);
   gimple_set_vuse (vcall_stmt, NULL);
   update_stmt (vcall_stmt);
-  icall_stmt = gimple_copy (vcall_stmt);
+  icall_stmt = static_cast<gimple_call> (gimple_copy (vcall_stmt));
   gimple_call_set_arg (icall_stmt, size_arg, icall_size);
   gsi_insert_before (&gsi, icall_stmt, GSI_SAME_STMT);
 
@@ -1654,6 +1656,7 @@ static bool
 gimple_stringops_transform (gimple_stmt_iterator *gsi)
 {
   gimple stmt = gsi_stmt (*gsi);
+  gimple_call call_stmt;
   tree fndecl;
   tree blck_size;
   enum built_in_function fcode;
@@ -1667,6 +1670,7 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi)
 
   if (gimple_code (stmt) != GIMPLE_CALL)
     return false;
+  call_stmt = static_cast<gimple_call> (stmt);
   fndecl = gimple_call_fndecl (stmt);
   if (!fndecl)
     return false;
@@ -1731,7 +1735,7 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi)
 	       (int)val);
       print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
     }
-  gimple_stringop_fixed_value (stmt, tree_val, prob, count, all);
+  gimple_stringop_fixed_value (call_stmt, tree_val, prob, count, all);
 
   return true;
 }
diff --git a/gcc/value-prof.h b/gcc/value-prof.h
index 57f249d..0dd9033 100644
--- a/gcc/value-prof.h
+++ b/gcc/value-prof.h
@@ -86,7 +86,8 @@ void gimple_move_stmt_histograms (struct function *, gimple, gimple);
 void verify_histograms (void);
 void free_histograms (void);
 void stringop_block_profile (gimple, unsigned int *, HOST_WIDE_INT *);
-gimple gimple_ic (gimple, struct cgraph_node *, int, gcov_type, gcov_type);
+gimple_call
+gimple_ic (gimple_call, struct cgraph_node *, int, gcov_type, gcov_type);
 
 
 /* In tree-profile.c.  */
diff --git a/gcc/vtable-verify.c b/gcc/vtable-verify.c
index fb26978..a276a8d 100644
--- a/gcc/vtable-verify.c
+++ b/gcc/vtable-verify.c
@@ -593,7 +593,7 @@ verify_bb_vtables (basic_block bb)
           tree vtbl_var_decl = NULL_TREE;
           struct vtbl_map_node *vtable_map_node;
           tree vtbl_decl = NULL_TREE;
-          gimple call_stmt;
+          gimple_call call_stmt;
           const char *vtable_name = "<unknown>";
           tree tmp0;
           bool found;
commit 9a89f418eceb2d11d6eff60cb8c76c11f7cdf77c
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Mon Nov 4 16:01:42 2013 -0500

    FIXME: conversion of gimple_call_set_lhs to a method

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index a9ab226..a12e581 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1587,7 +1587,7 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
       gimple_call_set_from_thunk (call, true);
       if (restmp)
 	{
-          gimple_call_set_lhs (call, restmp);
+          call->set_lhs (restmp);
 	  gcc_assert (useless_type_conversion_p (TREE_TYPE (restmp),
 						 TREE_TYPE (TREE_TYPE (alias))));
 	}
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b76479c..cd44f3d 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -29459,7 +29459,7 @@ add_condition_to_bb (tree function_decl, tree version_decl,
       predicate_decl = TREE_PURPOSE (predicate_chain);
       predicate_arg = TREE_VALUE (predicate_chain);
       call_cond_stmt = gimple_build_call (predicate_decl, 1, predicate_arg);
-      gimple_call_set_lhs (call_cond_stmt, cond_var);
+      call_cond_stmt->set_lhs (cond_var);
 
       gimple_set_block (call_cond_stmt, DECL_INITIAL (function_decl));
       gimple_set_bb (call_cond_stmt, new_bb);
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index b24961b..f7c399e 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -158,7 +158,7 @@ lower_function_body (void)
       arg = build_addr (disp_label, current_function_decl);
       t = builtin_decl_implicit (BUILT_IN_SETJMP_DISPATCHER);
       call = gimple_build_call (t, 1, arg);
-      gimple_call_set_lhs (call, disp_var);
+      call->set_lhs (disp_var);
       gsi_insert_after (&i, call, GSI_CONTINUE_LINKING);
 
       /* Build 'goto DISP_VAR;' and insert.  */
diff --git a/gcc/gimple.c b/gcc/gimple.c
index f31c935..a128582 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2252,7 +2252,7 @@ gimple_set_lhs (gimple stmt, tree lhs)
   if (code == GIMPLE_ASSIGN)
     gimple_assign_set_lhs (stmt, lhs);
   else if (code == GIMPLE_CALL)
-    gimple_call_set_lhs (static_cast<gimple_call> (stmt), lhs);
+    ((gimple_call)stmt)->set_lhs (lhs);
   else
     gcc_unreachable ();
 }
@@ -3083,7 +3083,7 @@ gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
     new_stmt = gimple_build_call_vec (gimple_call_fn (stmt), vargs);
   vargs.release ();
   if (gimple_call_lhs (stmt))
-    gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
+    new_stmt->set_lhs (gimple_call_lhs (stmt));
 
   gimple_set_vuse (new_stmt, gimple_vuse (stmt));
   gimple_set_vdef (new_stmt, gimple_vdef (stmt));
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 1180d3e..c9df1d9 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -292,6 +292,13 @@ struct GTY((tag("GSS_WITH_MEM_OPS")))
 struct GTY((tag("GSS_CALL")))
   gimple_statement_call : public gimple_statement_with_memory_ops_base
 {
+public:
+
+  /* Set LHS to be the LHS operand of this call statement.  */
+  inline void set_lhs (tree lhs);
+
+public:
+
   /* [ WORD 1-9 ] : base class */
 
   /* [ WORD 10-13 ]  */
@@ -2550,12 +2557,12 @@ gimple_call_lhs_ptr (const_gimple gs)
 
 /* Set LHS to be the LHS operand of call statement GS.  */
 
-static inline void
-gimple_call_set_lhs (gimple_call gs, tree lhs)
+inline void
+gimple_statement_call::set_lhs (tree lhs)
 {
-  gimple_set_op (gs, 0, lhs);
+  gimple_set_op (this, 0, lhs);
   if (lhs && TREE_CODE (lhs) == SSA_NAME)
-    SSA_NAME_DEF_STMT (lhs) = gs;
+    SSA_NAME_DEF_STMT (lhs) = this;
 }
 
 
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index e2c81b9..4cfc2e9 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1166,7 +1166,7 @@ build_stack_save_restore (gimple_call *save, gimple_call *restore)
 
   *save = gimple_build_call (builtin_decl_implicit (BUILT_IN_STACK_SAVE), 0);
   tmp_var = create_tmp_var (ptr_type_node, "saved_stack");
-  gimple_call_set_lhs (*save, tmp_var);
+  (*save)->set_lhs (tmp_var);
 
   *restore
     = gimple_build_call (builtin_decl_implicit (BUILT_IN_STACK_RESTORE),
@@ -3464,7 +3464,7 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value,
     {
       /* tmp = memcpy() */
       t = create_tmp_var (TREE_TYPE (to_ptr), NULL);
-      gimple_call_set_lhs (gs, t);
+      gs->set_lhs (t);
       gimplify_seq_add_stmt (seq_p, gs);
 
       *expr_p = build_simple_mem_ref (t);
@@ -3511,7 +3511,7 @@ gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value,
     {
       /* tmp = memset() */
       t = create_tmp_var (TREE_TYPE (to_ptr), NULL);
-      gimple_call_set_lhs (gs, t);
+      gs->set_lhs (t);
       gimplify_seq_add_stmt (seq_p, gs);
 
       *expr_p = build1 (INDIRECT_REF, TREE_TYPE (to), t);
@@ -4881,7 +4881,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
       gimple_call_set_fntype (assign, TREE_TYPE (fnptrtype));
       notice_special_calls (assign);
       if (!gimple_call_noreturn_p (assign))
-	gimple_call_set_lhs (call, *to_p);
+	call->set_lhs (*to_p);
     }
   else
     {
@@ -7792,7 +7792,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
 	    gimplify_arg (&cond, pre_p, EXPR_LOCATION (*expr_p));
 	    gimple_call call = gimple_build_call_internal (IFN_ANNOTATE, 2,
 							   cond, id);
-	    gimple_call_set_lhs (call, tmp);
+	    call->set_lhs (tmp);
 	    gimplify_seq_add_stmt (pre_p, call);
 	    *expr_p = tmp;
 	    ret = GS_ALL_DONE;
@@ -8995,7 +8995,7 @@ gimplify_function_tree (tree fndecl)
       x = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS);
       call = gimple_build_call (x, 1, integer_zero_node);
       tmp_var = create_tmp_var (ptr_type_node, "return_addr");
-      gimple_call_set_lhs (call, tmp_var);
+      call->set_lhs (tmp_var);
       gimplify_seq_add_stmt (&cleanup, call);
       x = builtin_decl_implicit (BUILT_IN_PROFILE_FUNC_EXIT);
       call = gimple_build_call (x, 2,
@@ -9007,7 +9007,7 @@ gimplify_function_tree (tree fndecl)
       x = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS);
       call = gimple_build_call (x, 1, integer_zero_node);
       tmp_var = create_tmp_var (ptr_type_node, "return_addr");
-      gimple_call_set_lhs (call, tmp_var);
+      call->set_lhs (tmp_var);
       gimplify_seq_add_stmt (&body, call);
       x = builtin_decl_implicit (BUILT_IN_PROFILE_FUNC_ENTER);
       call = gimple_build_call (x, 2,
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 642153d..5e8b068 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -3713,7 +3713,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
   new_stmt = gimple_build_call_vec (callee_decl, vargs);
   vargs.release ();
   if (gimple_call_lhs (stmt))
-    gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
+    new_stmt->set_lhs (gimple_call_lhs (stmt));
 
   gimple_set_block (new_stmt, gimple_block (stmt));
   if (gimple_has_location (stmt))
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 915533c..b7f8381 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1414,7 +1414,7 @@ split_function (struct split_point *split_point)
 		}
 	      if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
 		{
-		  gimple_call_set_lhs (call, build_simple_mem_ref (retval));
+		  call->set_lhs (build_simple_mem_ref (retval));
 		  gsi_insert_after (&gsi, call, GSI_NEW_STMT);
 		}
 	      else
@@ -1432,7 +1432,7 @@ split_function (struct split_point *split_point)
 		      gsi_insert_after (&gsi, cpy, GSI_NEW_STMT);
 		      retval = tem;
 		    }
-		  gimple_call_set_lhs (call, retval);
+		  call->set_lhs (retval);
 		  update_stmt (call);
 		}
 	    }
@@ -1468,9 +1468,9 @@ split_function (struct split_point *split_point)
 		    retval = make_ssa_name (retval, call);
 		}
 	      if (DECL_BY_REFERENCE (DECL_RESULT (current_function_decl)))
-	        gimple_call_set_lhs (call, build_simple_mem_ref (retval));
+	        call->set_lhs (build_simple_mem_ref (retval));
 	      else
-	        gimple_call_set_lhs (call, retval);
+	        call->set_lhs (retval);
 	    }
           gsi_insert_after (&gsi, call, GSI_NEW_STMT);
 	  ret = gimple_build_return (retval);
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index dcececc..3b7882d 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -2672,7 +2672,7 @@ build_omp_barrier (tree lhs)
 					   : BUILT_IN_GOMP_BARRIER);
   gimple_call g = gimple_build_call (fndecl, 0);
   if (lhs)
-    gimple_call_set_lhs (g, lhs);
+    g->set_lhs (lhs);
   return g;
 }
 
@@ -3113,7 +3113,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 		  stmt = gimple_build_call (atmp, 1, x);
 		  tmp = create_tmp_var_raw (ptr_type_node, NULL);
 		  gimple_add_tmp_var (tmp);
-		  gimple_call_set_lhs (stmt, tmp);
+		  stmt->set_lhs (tmp);
 
 		  gimple_seq_add_stmt (ilist, stmt);
 
@@ -3521,7 +3521,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
       TREE_NO_WARNING (uid) = 1;
       gimple_call call
 	= gimple_build_call_internal (IFN_GOMP_SIMD_LANE, 1, uid);
-      gimple_call_set_lhs (call, lane);
+      call->set_lhs (lane);
       gimple_stmt_iterator gsi = gsi_start_1 (gimple_omp_body_ptr (ctx->stmt));
       gsi_insert_before_without_update (&gsi, call, GSI_SAME_STMT);
       c = build_omp_clause (UNKNOWN_LOCATION, OMP_CLAUSE__SIMDUID_);
@@ -3538,7 +3538,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 	  {
 	    tree vf = create_tmp_var (unsigned_type_node, NULL);
 	    call = gimple_build_call_internal (IFN_GOMP_SIMD_VF, 1, uid);
-	    gimple_call_set_lhs (call, vf);
+	    call->set_lhs (vf);
 	    gimple_seq *seq = i == 0 ? ilist : dlist;
 	    gimple_seq_add_stmt (seq, call);
 	    tree t = build_int_cst (unsigned_type_node, 0);
@@ -3698,7 +3698,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
 			= gimple_build_call_internal (IFN_GOMP_SIMD_LAST_LANE,
 						      2, simduid,
 						      TREE_OPERAND (val, 1));
-		      gimple_call_set_lhs (g, lastlane);
+		      g->set_lhs (lastlane);
 		      gimple_seq_add_stmt (stmt_list, g);
 		    }
 		  new_var = build4 (ARRAY_REF, TREE_TYPE (val),
@@ -5547,7 +5547,7 @@ expand_omp_for_generic (struct omp_region *region,
     t = builtin_decl_explicit (BUILT_IN_GOMP_LOOP_END);
   gimple_call call = gimple_build_call (t, 0);
   if (gimple_omp_return_lhs (gsi_stmt (gsi)))
-    gimple_call_set_lhs (call, gimple_omp_return_lhs (gsi_stmt (gsi)));
+    call->set_lhs (gimple_omp_return_lhs (gsi_stmt (gsi)));
   gsi_insert_after (&gsi, call, GSI_SAME_STMT);
   gsi_remove (&gsi, true);
 
@@ -6939,7 +6939,7 @@ expand_omp_sections (struct omp_region *region)
       u = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_NEXT);
       call = gimple_build_call (u, 0);
     }
-  gimple_call_set_lhs (call, vin);
+  call->set_lhs (vin);
   gsi_insert_after (&si, call, GSI_SAME_STMT);
   gsi_remove (&si, true);
 
@@ -7029,7 +7029,7 @@ expand_omp_sections (struct omp_region *region)
 
       bfn_decl = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_NEXT);
       call = gimple_build_call (bfn_decl, 0);
-      gimple_call_set_lhs (call, vnext);
+      call->set_lhs (vnext);
       gsi_insert_after (&si, call, GSI_SAME_STMT);
       gsi_remove (&si, true);
 
@@ -7046,7 +7046,7 @@ expand_omp_sections (struct omp_region *region)
     t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END);
   call = gimple_build_call (t, 0);
   if (gimple_omp_return_lhs (gsi_stmt (si)))
-    gimple_call_set_lhs (call, gimple_omp_return_lhs (gsi_stmt (si)));
+    call->set_lhs (gimple_omp_return_lhs (gsi_stmt (si)));
   gsi_insert_after (&si, call, GSI_SAME_STMT);
   gsi_remove (&si, true);
 
@@ -8422,7 +8422,7 @@ lower_omp_single_simple (gimple single_stmt, gimple_seq *pre_p)
   decl = builtin_decl_explicit (BUILT_IN_GOMP_SINGLE_START);
   lhs = create_tmp_var (TREE_TYPE (TREE_TYPE (decl)), NULL);
   call = gimple_build_call (decl, 0);
-  gimple_call_set_lhs (call, lhs);
+  call->set_lhs (lhs);
   gimple_seq_add_stmt (pre_p, call);
 
   cond = gimple_build_cond (EQ_EXPR, lhs,
@@ -10010,7 +10010,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		gimple_call_set_fndecl (stmt, fndecl);
 		gimple_call_set_fntype (stmt, TREE_TYPE (fndecl));
 	      }
-	    gimple_call_set_lhs (call, lhs);
+	    call->set_lhs (lhs);
 	    tree fallthru_label;
 	    fallthru_label = create_artificial_label (UNKNOWN_LOCATION);
 	    gimple g;
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 0358b26..b9e1be6 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -1618,7 +1618,7 @@ lower_transaction (gimple_stmt_iterator *gsi, struct walk_stmt_info *wi)
 	gimple_build_call (builtin_decl_explicit (BUILT_IN_EH_POINTER),
 			   1, integer_zero_node);
       ptr = create_tmp_var (ptr_type_node, NULL);
-      gimple_call_set_lhs (call, ptr);
+      call->set_lhs (ptr);
       gimple_seq_add_stmt (&e_seq, call);
 
       g = gimple_build_call (builtin_decl_explicit (BUILT_IN_TM_COMMIT_EH),
@@ -2115,7 +2115,7 @@ build_tm_load (location_t loc, tree lhs, tree rhs, gimple_stmt_iterator *gsi)
   t = TREE_TYPE (TREE_TYPE (decl));
   if (useless_type_conversion_p (type, t))
     {
-      gimple_call_set_lhs (gcall, lhs);
+      gcall->set_lhs (lhs);
       gsi_insert_before (gsi, gcall, GSI_SAME_STMT);
     }
   else
@@ -2124,7 +2124,7 @@ build_tm_load (location_t loc, tree lhs, tree rhs, gimple_stmt_iterator *gsi)
       tree temp;
 
       temp = create_tmp_reg (t, NULL);
-      gimple_call_set_lhs (gcall, temp);
+      gcall->set_lhs (temp);
       gsi_insert_before (gsi, gcall, GSI_SAME_STMT);
 
       t = fold_build1 (VIEW_CONVERT_EXPR, type, temp);
@@ -2414,7 +2414,7 @@ expand_call_tm (struct tm_region *region,
 	      }
 	}
 
-      gimple_call_set_lhs (call_stmt, tmp);
+      call_stmt->set_lhs (tmp);
       update_stmt (stmt);
       stmt = gimple_build_assign (lhs, tmp);
       gimple_set_location (stmt, loc);
@@ -2701,7 +2701,7 @@ expand_transaction (struct tm_region *region, void *data ATTRIBUTE_UNUSED)
       region->original_transaction_was_outer = true;
     tree t = build_int_cst (tm_state_type, flags);
     gimple_call call = gimple_build_call (tm_start, 1, t);
-    gimple_call_set_lhs (call, tm_state);
+    call->set_lhs (tm_state);
     gimple_set_location (call, gimple_location (region->transaction_stmt));
 
     // Replace the GIMPLE_TRANSACTION with the call to BUILT_IN_TM_START.
@@ -4993,7 +4993,7 @@ ipa_tm_insert_gettmclone_call (struct cgraph_node *node,
 
   g = gimple_build_call (gettm_fn, 1, old_fn);
   ret = make_ssa_name (ret, g);
-  gimple_call_set_lhs (g, ret);
+  g->set_lhs (ret);
 
   gsi_insert_before (gsi, g, GSI_SAME_STMT);
 
@@ -5029,7 +5029,7 @@ ipa_tm_insert_gettmclone_call (struct cgraph_node *node,
       tree temp;
 
       temp = create_tmp_reg (rettype, 0);
-      gimple_call_set_lhs (stmt, temp);
+      stmt->set_lhs (temp);
 
       g2 = gimple_build_assign (lhs,
 				fold_build1 (VIEW_CONVERT_EXPR,
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 3cd625c..db43ea8 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -517,7 +517,7 @@ fixup_noreturn_call (gimple_call stmt)
   if (gimple_call_lhs (stmt))
     {
       tree op = gimple_call_lhs (stmt);
-      gimple_call_set_lhs (stmt, NULL_TREE);
+      stmt->set_lhs (NULL_TREE);
 
       /* We need to remove SSA name to avoid checking errors.
 	 All uses are dominated by the noreturn and thus will
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index aee1e26..325554f 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -957,7 +957,7 @@ expand_complex_libcall (gimple_stmt_iterator *gsi, tree ar, tree ai,
   fn = builtin_decl_explicit (bcode);
 
   stmt = gimple_build_call (fn, 4, ar, ai, br, bi);
-  gimple_call_set_lhs (stmt, lhs);
+  stmt->set_lhs (lhs);
   update_stmt (stmt);
   gsi_replace (gsi, stmt, false);
 
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 3347b7b..c83229f 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3207,7 +3207,7 @@ lower_resx (basic_block bb, gimple stmt, struct pointer_map_t *mnt_map)
 	  gimple_call call = gimple_build_call (fn, 1, src_nr);
 	  var = create_tmp_var (ptr_type_node, NULL);
 	  var = make_ssa_name (var, call);
-	  gimple_call_set_lhs (call, var);
+	  call->set_lhs (var);
 	  gsi_insert_before (&gsi, call, GSI_SAME_STMT);
 
 	  fn = builtin_decl_implicit (BUILT_IN_UNWIND_RESUME);
@@ -3583,7 +3583,7 @@ lower_eh_dispatch (basic_block src, gimple stmt)
 						       region_nr));
 	    filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
 	    filter = make_ssa_name (filter, call);
-	    gimple_call_set_lhs (call, filter);
+	    call->set_lhs (filter);
 	    gsi_insert_before (&gsi, call, GSI_SAME_STMT);
 
 	    /* Turn the default label into a default case.  */
@@ -3610,7 +3610,7 @@ lower_eh_dispatch (basic_block src, gimple stmt)
 						     region_nr));
 	filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
 	filter = make_ssa_name (filter, call);
-	gimple_call_set_lhs (call, filter);
+	call->set_lhs (filter);
 	gsi_insert_before (&gsi, call, GSI_SAME_STMT);
 
 	r->u.allowed.label = NULL;
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index 7b17a68..177d0e9 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -438,7 +438,7 @@ gen_emutls_addr (tree decl, struct lower_emutls_data *d)
       gimple_set_location (x, d->loc);
 
       addr = make_ssa_name (addr, x);
-      gimple_call_set_lhs (x, addr);
+      x->set_lhs (addr);
 
       gimple_seq_add_stmt (&d->seq, x);
 
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 83a3e27..e4c80a7 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1683,7 +1683,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
 	      gimple_call_set_va_arg_pack (new_call, false);
 	      gimple_set_location (new_call, gimple_location (stmt));
 	      gimple_set_block (new_call, gimple_block (stmt));
-	      gimple_call_set_lhs (new_call, gimple_call_lhs (stmt));
+	      new_call->set_lhs (gimple_call_lhs (stmt));
 
 	      gsi_replace (&copy_gsi, new_call, false);
 	      stmt = new_call;
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 5f5dcef..0258553 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -406,7 +406,7 @@ init_tmp_var_with_call (struct nesting_info *info, gimple_stmt_iterator *gsi,
   tree t;
 
   t = create_tmp_var_for (info, gimple_call_return_type (call), NULL);
-  gimple_call_set_lhs (call, t);
+  call->set_lhs (t);
   if (! gsi_end_p (*gsi))
     gimple_set_location (call, gimple_location (gsi_stmt (*gsi)));
   gsi_insert_before (gsi, call, GSI_SAME_STMT);
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 35c97b6..3acb721 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4476,7 +4476,7 @@ replace_removed_params_ssa_names (gimple stmt,
   if (is_gimple_assign (stmt))
     gimple_assign_set_lhs (stmt, name);
   else if (is_gimple_call (stmt))
-    gimple_call_set_lhs (static_cast<gimple_call> (stmt), name);
+    static_cast<gimple_call> (stmt)->set_lhs (name);
   else
     gimple_phi_set_result (stmt, name);
 
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 3527848..4451585 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1241,7 +1241,7 @@ eliminate_unnecessary_stmts (void)
 		      fprintf (dump_file, "\n");
 		    }
 
-		  gimple_call_set_lhs (call_stmt, NULL_TREE);
+		  call_stmt->set_lhs (NULL_TREE);
 		  maybe_clean_or_replace_eh_stmt (stmt, stmt);
 		  update_stmt (stmt);
 		  release_ssa_name (name);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index c0415d4..6ad45c9 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1653,7 +1653,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
 		 memset call.  */
 	      gimple_call call_stmt1 = static_cast <gimple_call> (stmt1);
 	      if (lhs1 && DECL_FUNCTION_CODE (callee1) == BUILT_IN_MEMPCPY)
-		gimple_call_set_lhs (call_stmt1, NULL_TREE);
+		call_stmt1->set_lhs (NULL_TREE);
 	      gimple_call_set_arg (stmt1, 1, new_str_cst);
 	      gimple_call_set_arg (stmt1, 2,
 				   build_int_cst (TREE_TYPE (len1), src_len));
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 6253c3d..2ffa38a 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -771,7 +771,7 @@ execute_cse_sincos_1 (tree name)
     return false;
   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);
+  call_stmt->set_lhs (res);
 
   def_stmt = SSA_NAME_DEF_STMT (name);
   if (!SSA_NAME_IS_DEFAULT_DEF (name)
@@ -2022,7 +2022,7 @@ execute_optimize_bswap (void)
 	      gsi_insert_after (&gsi, convert_stmt, GSI_SAME_STMT);
 	    }
 
-	  gimple_call_set_lhs (call, bswap_tmp);
+	  call->set_lhs (bswap_tmp);
 
 	  if (dump_file)
 	    {
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 4565de0..0c84581 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -700,7 +700,7 @@ static void
 finish_update_gimple_call (gimple_stmt_iterator *si_p, gimple_call new_stmt,
 			   gimple stmt)
 {
-  gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
+  new_stmt->set_lhs (gimple_call_lhs (stmt));
   move_ssa_defining_stmt_for_defs (new_stmt, stmt);
   gimple_set_vuse (new_stmt, gimple_vuse (stmt));
   gimple_set_vdef (new_stmt, gimple_vdef (stmt));
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 982c6d2..0e66f7c 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -4097,7 +4097,7 @@ attempt_builtin_powi (gimple stmt, vec<operand_entry_t> *ops)
 	      pow_stmt = gimple_build_call (powi_fndecl, 2, rf1->repr, 
 					    build_int_cst (integer_type_node,
 							   power));
-	      gimple_call_set_lhs (pow_stmt, iter_result);
+	      pow_stmt->set_lhs (iter_result);
 	      gimple_set_location (pow_stmt, gimple_location (stmt));
 	      gsi_insert_before (&gsi, pow_stmt, GSI_SAME_STMT);
 
@@ -4198,7 +4198,7 @@ attempt_builtin_powi (gimple stmt, vec<operand_entry_t> *ops)
 	  pow_stmt = gimple_build_call (powi_fndecl, 2, rf1->repr, 
 					build_int_cst (integer_type_node,
 						       power));
-	  gimple_call_set_lhs (pow_stmt, iter_result);
+	  pow_stmt->set_lhs (iter_result);
 	  gimple_set_location (pow_stmt, gimple_location (stmt));
 	  gsi_insert_before (&gsi, pow_stmt, GSI_SAME_STMT);
 	}
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index ad18fc1..f47b20f 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -441,7 +441,7 @@ get_string_length (strinfo si)
 	  tem = unshare_expr (gimple_call_arg (stmt, 0));
 	  lenstmt_call = gimple_build_call (fn, 1, tem);
 	  lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), lenstmt_call);
-	  gimple_call_set_lhs (lenstmt_call, lhs);
+	  lenstmt_call->set_lhs (lhs);
 	  gimple_set_vuse (lenstmt_call, gimple_vuse (stmt));
 	  gsi_insert_before (&gsi, lenstmt_call, GSI_SAME_STMT);
 	  tem = gimple_call_arg (stmt, 0);
@@ -474,7 +474,7 @@ get_string_length (strinfo si)
 	    }
 	  gimple_call_set_fndecl (stmt, fn);
 	  lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), stmt);
-	  gimple_call_set_lhs (call_stmt, lhs);
+	  call_stmt->set_lhs (lhs);
 	  update_stmt (stmt);
 	  if (dump_file && (dump_flags & TDF_DETAILS) != 0)
 	    {
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 2ddaebe..7b8d20d 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4468,7 +4468,7 @@ vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
 	vect_create_destination_var (scalar_dest,
 				     gimple_call_return_type (call_stmt));
       new_temp = make_ssa_name (vec_dest, call_stmt);
-      gimple_call_set_lhs (call_stmt, new_temp);
+      call_stmt->set_lhs (new_temp);
 
       if (compute_in_loop)
 	gsi_insert_before (gsi, call_stmt, GSI_SAME_STMT);
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 2dc918f..b1a1e5f 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -806,7 +806,7 @@ vect_recog_pow_pattern (vec<gimple> *stmts, tree *type_in,
 	      != NULL_TREE)
 	    {
 	      var = vect_recog_temp_ssa_var (TREE_TYPE (base), stmt);
-	      gimple_call_set_lhs (stmt, var);
+	      stmt->set_lhs (var);
 	      return stmt;
 	    }
 	}
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 906a44d..b982046 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1943,7 +1943,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 		  gimple_call call = gimple_build_call_vec (fndecl, vargs);
 		  new_stmt = call;
 		  new_temp = make_ssa_name (vec_dest, new_stmt);
-		  gimple_call_set_lhs (call, new_temp);
+		  call->set_lhs (new_temp);
 		  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 		  SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
 		}
@@ -1996,7 +1996,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	      gimple_call call = gimple_build_call_vec (fndecl, vargs);
 	      new_stmt = call;
 	      new_temp = make_ssa_name (vec_dest, new_stmt);
-	      gimple_call_set_lhs (call, new_temp);
+	      call->set_lhs (new_temp);
 	    }
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 
@@ -2044,7 +2044,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 		  gimple_call call = gimple_build_call_vec (fndecl, vargs);
 		  new_stmt = call;
 		  new_temp = make_ssa_name (vec_dest, new_stmt);
-		  gimple_call_set_lhs (call, new_temp);
+		  call->set_lhs (new_temp);
 		  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 		  SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
 		}
@@ -2084,7 +2084,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  gimple_call call = gimple_build_call_vec (fndecl, vargs);
 	  new_stmt = call;
 	  new_temp = make_ssa_name (vec_dest, new_stmt);
-	  gimple_call_set_lhs (call, new_temp);
+	  call->set_lhs (new_temp);
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 
 	  if (j == 0)
@@ -2164,7 +2164,7 @@ vect_gen_widened_results_half (enum tree_code code,
 	call = gimple_build_call (decl, 1, vec_oprnd0);
       new_stmt = call;
       new_temp = make_ssa_name (vec_dest, new_stmt);
-      gimple_call_set_lhs (call, new_temp);
+      call->set_lhs (new_temp);
     }
   else
     {
@@ -2719,7 +2719,7 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
 		  gimple_call call = gimple_build_call (decl1, 1, vop0);
 		  new_stmt = call;
 		  new_temp = make_ssa_name (vec_dest, new_stmt);
-		  gimple_call_set_lhs (call, new_temp);
+		  call->set_lhs (new_temp);
 		}
 	      else
 		{
@@ -2831,7 +2831,7 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
 		      gimple_call call = gimple_build_call (decl1, 1, vop0);
 		      new_stmt = call;
 		      new_temp = make_ssa_name (vec_dest, new_stmt);
-		      gimple_call_set_lhs (call, new_temp);
+		      call->set_lhs (new_temp);
 		    }
 		  else
 		    {
@@ -2890,7 +2890,7 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
 		    gimple_call call = gimple_build_call (decl1, 1, vop0);
 		    new_stmt = call;
 		    new_temp = make_ssa_name (vec_dest, new_stmt);
-		    gimple_call_set_lhs (call, new_temp);
+		    call->set_lhs (new_temp);
 		  }
 		else
 		  {
@@ -4251,7 +4251,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
 	  gimple_call call = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array);
 	  new_stmt = call;
-	  gimple_call_set_lhs (call, data_ref);
+	  call->set_lhs (data_ref);
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 	}
       else
@@ -4752,7 +4752,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 			  == TYPE_VECTOR_SUBPARTS (rettype));
 	      var = vect_get_new_vect_var (rettype, vect_simple_var, NULL);
 	      op = make_ssa_name (var, new_stmt);
-	      gimple_call_set_lhs (call, op);
+	      call->set_lhs (op);
 	      vect_finish_stmt_generation (stmt, new_stmt, gsi);
 	      var = make_ssa_name (vec_dest, NULL);
 	      op = build1 (VIEW_CONVERT_EXPR, vectype, op);
@@ -4763,7 +4763,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  else
 	    {
 	      var = make_ssa_name (vec_dest, new_stmt);
-	      gimple_call_set_lhs (call, var);
+	      call->set_lhs (var);
 	    }
 
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
@@ -5124,7 +5124,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
 	  data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
 	  gimple_call call = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref);
 	  new_stmt = call;
-	  gimple_call_set_lhs (call, vec_array);
+	  call->set_lhs (vec_array);
 	  vect_finish_stmt_generation (stmt, new_stmt, gsi);
 
 	  /* Extract each vector into an SSA_NAME.  */
diff --git a/gcc/tsan.c b/gcc/tsan.c
index de95625..8a8dccf 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -489,8 +489,7 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
 		    args[1] = var;
 		  }
 		gimple_call call_stmt = as_a<gimple_statement_call> (stmt);
-		gimple_call_set_lhs (call_stmt,
-				     make_ssa_name (TREE_TYPE (lhs), NULL));
+		call_stmt->set_lhs (make_ssa_name (TREE_TYPE (lhs), NULL));
 		/* BIT_NOT_EXPR stands for NAND.  */
 		if (tsan_atomic_table[i].code == BIT_NOT_EXPR)
 		  {
@@ -572,7 +571,7 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
 						  args[1],
 						  gimple_assign_lhs (g));
 		gimple_call call_stmt = as_a<gimple_statement_call> (stmt);
-		gimple_call_set_lhs (call_stmt, t);
+		call_stmt->set_lhs (t);
 		update_stmt (stmt);
 		gsi_insert_after (gsi, g, GSI_NEW_STMT);
 	      }
@@ -660,7 +659,7 @@ instrument_func_entry (void)
   builtin_decl = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS);
   g = gimple_build_call (builtin_decl, 1, integer_zero_node);
   ret_addr = make_ssa_name (ptr_type_node, NULL);
-  gimple_call_set_lhs (g, ret_addr);
+  g->set_lhs (ret_addr);
   gimple_set_location (g, cfun->function_start_locus);
   gsi_insert_before (&gsi, g, GSI_SAME_STMT);
 
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 7ca9f4d..29d40a1 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1332,7 +1332,7 @@ gimple_ic (gimple_call icall_stmt, struct cgraph_node *direct_call,
   gimple_call_set_fndecl (dcall_stmt, direct_call->decl);
   dflags = flags_from_decl_or_type (direct_call->decl);
   if ((dflags & ECF_NORETURN) != 0)
-    gimple_call_set_lhs (dcall_stmt, NULL_TREE);
+    dcall_stmt->set_lhs (NULL_TREE);
   gsi_insert_before (&gsi, dcall_stmt, GSI_SAME_STMT);
 
   /* Fix CFG. */
@@ -1397,11 +1397,9 @@ gimple_ic (gimple_call icall_stmt, struct cgraph_node *direct_call,
     {
       tree result = gimple_call_lhs (icall_stmt);
       gimple phi = create_phi_node (result, join_bb);
-      gimple_call_set_lhs (icall_stmt,
-			   duplicate_ssa_name (result, icall_stmt));
+      icall_stmt->set_lhs (duplicate_ssa_name (result, icall_stmt));
       add_phi_arg (phi, gimple_call_lhs (icall_stmt), e_ij, UNKNOWN_LOCATION);
-      gimple_call_set_lhs (dcall_stmt,
-			   duplicate_ssa_name (result, dcall_stmt));
+      dcall_stmt->set_lhs (duplicate_ssa_name (result, dcall_stmt));
       add_phi_arg (phi, gimple_call_lhs (dcall_stmt), e_dj, UNKNOWN_LOCATION);
     }
 
@@ -1637,11 +1635,9 @@ gimple_stringop_fixed_value (gimple_call vcall_stmt, tree icall_size, int prob,
     {
       tree result = gimple_call_lhs (vcall_stmt);
       gimple phi = create_phi_node (result, join_bb);
-      gimple_call_set_lhs (vcall_stmt,
-			   duplicate_ssa_name (result, vcall_stmt));
+      vcall_stmt->set_lhs (duplicate_ssa_name (result, vcall_stmt));
       add_phi_arg (phi, gimple_call_lhs (vcall_stmt), e_vj, UNKNOWN_LOCATION);
-      gimple_call_set_lhs (icall_stmt,
-			   duplicate_ssa_name (result, icall_stmt));
+      icall_stmt->set_lhs (duplicate_ssa_name (result, icall_stmt));
       add_phi_arg (phi, gimple_call_lhs (icall_stmt), e_ij, UNKNOWN_LOCATION);
     }
 
diff --git a/gcc/vtable-verify.c b/gcc/vtable-verify.c
index a276a8d..d743c3e 100644
--- a/gcc/vtable-verify.c
+++ b/gcc/vtable-verify.c
@@ -686,7 +686,7 @@ verify_bb_vtables (basic_block bb)
                      return value, and make the call_stmt use the
                      variable for that purpose.  */
                   tmp0 = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "VTV");
-                  gimple_call_set_lhs (call_stmt, tmp0);
+                  call_stmt->set_lhs (tmp0);
                   update_stmt (call_stmt);
 
                   /* Find the next stmt, after the vptr assignment

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]