]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gimple.h
Optimize ODR enum streaming
[thirdparty/gcc.git] / gcc / gimple.h
index 5503625c9f1788816a4f63dabe0cc5ed3e698bca..ca7fec6247ea64286ff15c15a81e131acd60c86c 100644 (file)
@@ -1,6 +1,6 @@
 /* Gimple IR definitions.
 
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2020 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez <aldyh@redhat.com>
 
 This file is part of GCC.
@@ -22,7 +22,10 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_GIMPLE_H
 #define GCC_GIMPLE_H
 
-typedef gimple gimple_seq_node;
+#include "tree-ssa-alias.h"
+#include "gimple-expr.h"
+
+typedef gimple *gimple_seq_node;
 
 enum gimple_code {
 #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
@@ -34,23 +37,78 @@ enum gimple_code {
 extern const char *const gimple_code_name[];
 extern const unsigned char gimple_rhs_class_table[];
 
+/* Strip the outermost pointer, from tr1/type_traits.  */
+template<typename T> struct remove_pointer { typedef T type; };
+template<typename T> struct remove_pointer<T *> { typedef T type; };
+
 /* Error out if a gimple tuple is addressed incorrectly.  */
 #if defined ENABLE_GIMPLE_CHECKING
 #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
-extern void gimple_check_failed (const_gimple, const char *, int,          \
+extern void gimple_check_failed (const gimple *, const char *, int,        \
                                  const char *, enum gimple_code,           \
-                                enum tree_code) ATTRIBUTE_NORETURN;
+                                enum tree_code) ATTRIBUTE_NORETURN        \
+                                                ATTRIBUTE_COLD;
 
 #define GIMPLE_CHECK(GS, CODE)                                         \
   do {                                                                 \
-    const_gimple __gs = (GS);                                          \
+    const gimple *__gs = (GS);                                         \
     if (gimple_code (__gs) != (CODE))                                  \
       gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__,     \
                           (CODE), ERROR_MARK);                         \
   } while (0)
+template <typename T>
+static inline T
+GIMPLE_CHECK2(const gimple *gs,
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+             const char *file = __builtin_FILE (),
+             int line = __builtin_LINE (),
+             const char *fun = __builtin_FUNCTION ())
+#else
+             const char *file = __FILE__,
+             int line = __LINE__,
+             const char *fun = NULL)
+#endif
+{
+  T ret = dyn_cast <T> (gs);
+  if (!ret)
+    gimple_check_failed (gs, file, line, fun,
+                        remove_pointer<T>::type::code_, ERROR_MARK);
+  return ret;
+}
+template <typename T>
+static inline T
+GIMPLE_CHECK2(gimple *gs,
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+             const char *file = __builtin_FILE (),
+             int line = __builtin_LINE (),
+             const char *fun = __builtin_FUNCTION ())
+#else
+             const char *file = __FILE__,
+             int line = __LINE__,
+             const char *fun = NULL)
+#endif
+{
+  T ret = dyn_cast <T> (gs);
+  if (!ret)
+    gimple_check_failed (gs, file, line, fun,
+                        remove_pointer<T>::type::code_, ERROR_MARK);
+  return ret;
+}
 #else  /* not ENABLE_GIMPLE_CHECKING  */
 #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
 #define GIMPLE_CHECK(GS, CODE)                 (void)0
+template <typename T>
+static inline T
+GIMPLE_CHECK2(gimple *gs)
+{
+  return as_a <T> (gs);
+}
+template <typename T>
+static inline T
+GIMPLE_CHECK2(const gimple *gs)
+{
+  return as_a <T> (gs);
+}
 #endif
 
 /* Class of GIMPLE expressions suitable for the RHS of assignments.  See
@@ -66,7 +124,7 @@ enum gimple_rhs_class
 };
 
 /* Specific flags for individual GIMPLE statements.  These flags are
-   always stored in gimple_statement_base.subcode and they may only be
+   always stored in gimple.subcode and they may only be
    defined for statement codes that do not use subcodes.
 
    Values for the masks can overlap as long as the overlapping values
@@ -79,6 +137,7 @@ enum gimple_rhs_class
 enum gf_mask {
     GF_ASM_INPUT               = 1 << 0,
     GF_ASM_VOLATILE            = 1 << 1,
+    GF_ASM_INLINE              = 1 << 2,
     GF_CALL_FROM_THUNK         = 1 << 0,
     GF_CALL_RETURN_SLOT_OPT    = 1 << 1,
     GF_CALL_TAILCALL           = 1 << 2,
@@ -87,28 +146,45 @@ enum gf_mask {
     GF_CALL_ALLOCA_FOR_VAR     = 1 << 5,
     GF_CALL_INTERNAL           = 1 << 6,
     GF_CALL_CTRL_ALTERING       = 1 << 7,
-    GF_CALL_WITH_BOUNDS        = 1 << 8,
+    GF_CALL_MUST_TAIL_CALL     = 1 << 9,
+    GF_CALL_BY_DESCRIPTOR      = 1 << 10,
+    GF_CALL_NOCF_CHECK         = 1 << 11,
     GF_OMP_PARALLEL_COMBINED   = 1 << 0,
+    GF_OMP_PARALLEL_GRID_PHONY = 1 << 1,
+    GF_OMP_TASK_TASKLOOP       = 1 << 0,
+    GF_OMP_TASK_TASKWAIT       = 1 << 1,
     GF_OMP_FOR_KIND_MASK       = (1 << 3) - 1,
     GF_OMP_FOR_KIND_FOR                = 0,
     GF_OMP_FOR_KIND_DISTRIBUTE = 1,
-    GF_OMP_FOR_KIND_CILKFOR     = 2,
-    GF_OMP_FOR_KIND_OACC_LOOP  = 3,
-    /* Flag for SIMD variants of OMP_FOR kinds.  */
-    GF_OMP_FOR_SIMD            = 1 << 2,
-    GF_OMP_FOR_KIND_SIMD       = GF_OMP_FOR_SIMD | 0,
-    GF_OMP_FOR_KIND_CILKSIMD   = GF_OMP_FOR_SIMD | 1,
+    GF_OMP_FOR_KIND_TASKLOOP   = 2,
+    GF_OMP_FOR_KIND_OACC_LOOP  = 4,
+    GF_OMP_FOR_KIND_GRID_LOOP  = 5,
+    GF_OMP_FOR_KIND_SIMD       = 6,
     GF_OMP_FOR_COMBINED                = 1 << 3,
     GF_OMP_FOR_COMBINED_INTO   = 1 << 4,
-    GF_OMP_TARGET_KIND_MASK    = (1 << 3) - 1,
+    /* The following flag must not be used on GF_OMP_FOR_KIND_GRID_LOOP loop
+       statements.  */
+    GF_OMP_FOR_GRID_PHONY      = 1 << 5,
+    /* The following two flags should only be set on GF_OMP_FOR_KIND_GRID_LOOP
+       loop statements.  */
+    GF_OMP_FOR_GRID_INTRA_GROUP        = 1 << 5,
+    GF_OMP_FOR_GRID_GROUP_ITER  = 1 << 6,
+    GF_OMP_TARGET_KIND_MASK    = (1 << 4) - 1,
     GF_OMP_TARGET_KIND_REGION  = 0,
     GF_OMP_TARGET_KIND_DATA    = 1,
     GF_OMP_TARGET_KIND_UPDATE  = 2,
-    GF_OMP_TARGET_KIND_OACC_PARALLEL = 3,
-    GF_OMP_TARGET_KIND_OACC_KERNELS = 4,
-    GF_OMP_TARGET_KIND_OACC_DATA = 5,
-    GF_OMP_TARGET_KIND_OACC_UPDATE = 6,
-    GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 7,
+    GF_OMP_TARGET_KIND_ENTER_DATA = 3,
+    GF_OMP_TARGET_KIND_EXIT_DATA = 4,
+    GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
+    GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
+    GF_OMP_TARGET_KIND_OACC_SERIAL = 7,
+    GF_OMP_TARGET_KIND_OACC_DATA = 8,
+    GF_OMP_TARGET_KIND_OACC_UPDATE = 9,
+    GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 10,
+    GF_OMP_TARGET_KIND_OACC_DECLARE = 11,
+    GF_OMP_TARGET_KIND_OACC_HOST_DATA = 12,
+    GF_OMP_TEAMS_GRID_PHONY    = 1 << 0,
+    GF_OMP_TEAMS_HOST          = 1 << 1,
 
     /* True on an GIMPLE_OMP_RETURN statement if the return does not require
        a thread synchronization via some sort of barrier.  The exact barrier
@@ -117,18 +193,18 @@ enum gf_mask {
     GF_OMP_RETURN_NOWAIT       = 1 << 0,
 
     GF_OMP_SECTION_LAST                = 1 << 0,
-    GF_OMP_ATOMIC_NEED_VALUE   = 1 << 0,
-    GF_OMP_ATOMIC_SEQ_CST      = 1 << 1,
+    GF_OMP_ATOMIC_MEMORY_ORDER  = (1 << 3) - 1,
+    GF_OMP_ATOMIC_NEED_VALUE   = 1 << 3,
     GF_PREDICT_TAKEN           = 1 << 15
 };
 
-/* Currently, there are only two types of gimple debug stmt.  Others are
-   envisioned, for example, to enable the generation of is_stmt notes
-   in line number information, to mark sequence points, etc.  This
-   subcode is to be used to tell them apart.  */
+/* This subcode tells apart different kinds of stmts that are not used
+   for codegen, but rather to retain debug information.  */
 enum gimple_debug_subcode {
   GIMPLE_DEBUG_BIND = 0,
-  GIMPLE_DEBUG_SOURCE_BIND = 1
+  GIMPLE_DEBUG_SOURCE_BIND = 1,
+  GIMPLE_DEBUG_BEGIN_STMT = 2,
+  GIMPLE_DEBUG_INLINE_ENTRY = 3
 };
 
 /* Masks for selecting a pass local flag (PLF) to work on.  These
@@ -143,7 +219,7 @@ enum plf_mask {
 
 struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
            chain_next ("%h.next"), variable_size))
-  gimple_statement_base
+  gimple
 {
   /* [ WORD 1 ]
      Main identifying code for a tuple.  */
@@ -204,8 +280,8 @@ struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
      A gimple statement is hence also a double-ended list of
      statements, with the pointer itself being the first element,
      and the prev pointer being the last.  */
-  gimple next;
-  gimple GTY((skip)) prev;
+  gimple *next;
+  gimple *GTY((skip)) prev;
 };
 
 
@@ -213,7 +289,7 @@ struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
 
 /* This gimple subclass has no tag value.  */
 struct GTY(())
-  gimple_statement_with_ops_base : public gimple_statement_base
+  gimple_statement_with_ops_base : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -294,13 +370,15 @@ struct GTY((tag("GSS_CALL")))
      of this structure.  In particular, this means that this
      structure cannot be embedded inside another one.  */
   tree GTY((length ("%h.num_ops"))) op[1];
+
+  static const enum gimple_code code_ = GIMPLE_CALL;
 };
 
 
 /* OMP statements.  */
 
 struct GTY((tag("GSS_OMP")))
-  gimple_statement_omp : public gimple_statement_base
+  gimple_statement_omp : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -312,7 +390,7 @@ struct GTY((tag("GSS_OMP")))
 /* GIMPLE_BIND */
 
 struct GTY((tag("GSS_BIND")))
-  gbind : public gimple_statement_base
+  gbind : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -321,7 +399,7 @@ struct GTY((tag("GSS_BIND")))
   tree vars;
 
   /* [ WORD 8 ]
-     This is different than the BLOCK field in gimple_statement_base,
+     This is different than the BLOCK field in gimple,
      which is analogous to TREE_BLOCK (i.e., the lexical block holding
      this statement).  This field is the equivalent of BIND_EXPR_BLOCK
      in tree land (i.e., the lexical scope defined by this bind).  See
@@ -336,7 +414,7 @@ struct GTY((tag("GSS_BIND")))
 /* GIMPLE_CATCH */
 
 struct GTY((tag("GSS_CATCH")))
-  gcatch : public gimple_statement_base
+  gcatch : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -351,7 +429,7 @@ struct GTY((tag("GSS_CATCH")))
 /* GIMPLE_EH_FILTER */
 
 struct GTY((tag("GSS_EH_FILTER")))
-  geh_filter : public gimple_statement_base
+  geh_filter : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -367,7 +445,7 @@ struct GTY((tag("GSS_EH_FILTER")))
 /* GIMPLE_EH_ELSE */
 
 struct GTY((tag("GSS_EH_ELSE")))
-  geh_else : public gimple_statement_base
+  geh_else : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -378,7 +456,7 @@ struct GTY((tag("GSS_EH_ELSE")))
 /* GIMPLE_EH_MUST_NOT_THROW */
 
 struct GTY((tag("GSS_EH_MNT")))
-  geh_mnt : public gimple_statement_base
+  geh_mnt : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -389,7 +467,7 @@ struct GTY((tag("GSS_EH_MNT")))
 /* GIMPLE_PHI */
 
 struct GTY((tag("GSS_PHI")))
-  gphi : public gimple_statement_base
+  gphi : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -408,7 +486,7 @@ struct GTY((tag("GSS_PHI")))
 /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
 
 struct GTY((tag("GSS_EH_CTRL")))
-  gimple_statement_eh_ctrl : public gimple_statement_base
+  gimple_statement_eh_ctrl : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -435,7 +513,7 @@ struct GTY((tag("GSS_EH_CTRL")))
 /* GIMPLE_TRY */
 
 struct GTY((tag("GSS_TRY")))
-  gtry : public gimple_statement_base
+  gtry : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -465,7 +543,7 @@ enum gimple_try_flags
 /* GIMPLE_WITH_CLEANUP_EXPR */
 
 struct GTY((tag("GSS_WCE")))
-  gimple_statement_wce : public gimple_statement_base
+  gimple_statement_wce : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -512,7 +590,10 @@ struct GTY((tag("GSS_OMP_CRITICAL")))
 {
   /* [ WORD 1-7 ] : base class */
 
-  /* [ WORD 8 ]
+  /* [ WORD 8 ]  */
+  tree clauses;
+
+  /* [ WORD 9 ]
      Critical section name.  */
   tree name;
 };
@@ -558,7 +639,7 @@ struct GTY((tag("GSS_OMP_FOR")))
 };
 
 
-/* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK */
+/* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK, GIMPLE_OMP_TEAMS */
 
 struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
   gimple_statement_omp_parallel_layout : public gimple_statement_omp
@@ -584,7 +665,8 @@ struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
 {
     /* No extra fields; adds invariant:
          stmt->code == GIMPLE_OMP_PARALLEL
-        || stmt->code == GIMPLE_OMP_TASK.  */
+        || stmt->code == GIMPLE_OMP_TASK
+        || stmt->code == GIMPLE_OMP_TEAMS.  */
 };
 
 /* GIMPLE_OMP_PARALLEL */
@@ -647,7 +729,7 @@ struct GTY((tag("GSS_OMP_SECTIONS")))
          do not need the body field.  */
 
 struct GTY((tag("GSS_OMP_CONTINUE")))
-  gomp_continue : public gimple_statement_base
+  gomp_continue : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -658,14 +740,15 @@ struct GTY((tag("GSS_OMP_CONTINUE")))
   tree control_use;
 };
 
-/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
+/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_ORDERED, GIMPLE_OMP_TASKGROUP,
+   GIMPLE_OMP_SCAN.  */
 
 struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
   gimple_statement_omp_single_layout : public gimple_statement_omp
 {
   /* [ WORD 1-7 ] : base class */
 
-  /* [ WORD 7 ]  */
+  /* [ WORD 8 ]  */
   tree clauses;
 };
 
@@ -676,20 +759,34 @@ struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
          stmt->code == GIMPLE_OMP_SINGLE.  */
 };
 
-struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
-  gomp_teams : public gimple_statement_omp_single_layout
+struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
+  gomp_teams : public gimple_statement_omp_taskreg
 {
     /* No extra fields; adds invariant:
          stmt->code == GIMPLE_OMP_TEAMS.  */
 };
 
+struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
+  gomp_ordered : public gimple_statement_omp_single_layout
+{
+    /* No extra fields; adds invariant:
+        stmt->code == GIMPLE_OMP_ORDERED.  */
+};
+
+struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
+  gomp_scan : public gimple_statement_omp_single_layout
+{
+    /* No extra fields; adds invariant:
+        stmt->code == GIMPLE_OMP_SCAN.  */
+};
+
 
 /* GIMPLE_OMP_ATOMIC_LOAD.
-   Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
+   Note: This is based on gimple, not g_s_omp, because g_s_omp
    contains a sequence, which we don't need here.  */
 
 struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
-  gomp_atomic_load : public gimple_statement_base
+  gomp_atomic_load : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -701,7 +798,7 @@ struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
    See note on GIMPLE_OMP_ATOMIC_LOAD.  */
 
 struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
-  gimple_statement_omp_atomic_store_layout : public gimple_statement_base
+  gimple_statement_omp_atomic_store_layout : public gimple
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -761,8 +858,10 @@ struct GTY((tag("GSS_TRANSACTION")))
   /* [ WORD 10 ] */
   gimple_seq body;
 
-  /* [ WORD 11 ] */
-  tree label;
+  /* [ WORD 11-13 ] */
+  tree label_norm;
+  tree label_uninst;
+  tree label_over;
 };
 
 #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP)  SYM,
@@ -780,6 +879,7 @@ struct GTY((tag("GSS_WITH_OPS")))
   gcond : public gimple_statement_with_ops
 {
   /* no additional fields; this uses the layout for GSS_WITH_OPS. */
+  static const enum gimple_code code_ = GIMPLE_COND;
 };
 
 /* A statement with the invariant that
@@ -829,6 +929,7 @@ struct GTY((tag("GSS_WITH_OPS")))
 struct GTY((tag("GSS_WITH_MEM_OPS")))
   gassign : public gimple_statement_with_memory_ops
 {
+  static const enum gimple_code code_ = GIMPLE_ASSIGN;
   /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
 };
 
@@ -845,7 +946,7 @@ struct GTY((tag("GSS_WITH_MEM_OPS")))
 template <>
 template <>
 inline bool
-is_a_helper <gasm *>::test (gimple gs)
+is_a_helper <gasm *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_ASM;
 }
@@ -853,7 +954,15 @@ is_a_helper <gasm *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gassign *>::test (gimple gs)
+is_a_helper <gassign *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_ASSIGN;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gassign *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_ASSIGN;
 }
@@ -861,7 +970,7 @@ is_a_helper <gassign *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gbind *>::test (gimple gs)
+is_a_helper <gbind *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_BIND;
 }
@@ -869,7 +978,7 @@ is_a_helper <gbind *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gcall *>::test (gimple gs)
+is_a_helper <gcall *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_CALL;
 }
@@ -877,7 +986,7 @@ is_a_helper <gcall *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gcatch *>::test (gimple gs)
+is_a_helper <gcatch *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_CATCH;
 }
@@ -885,7 +994,15 @@ is_a_helper <gcatch *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gcond *>::test (gimple gs)
+is_a_helper <gcond *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_COND;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gcond *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_COND;
 }
@@ -893,7 +1010,15 @@ is_a_helper <gcond *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gdebug *>::test (gimple gs)
+is_a_helper <gdebug *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_DEBUG;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gdebug *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_DEBUG;
 }
@@ -901,7 +1026,15 @@ is_a_helper <gdebug *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <ggoto *>::test (gimple gs)
+is_a_helper <ggoto *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_GOTO;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const ggoto *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_GOTO;
 }
@@ -909,7 +1042,15 @@ is_a_helper <ggoto *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <glabel *>::test (gimple gs)
+is_a_helper <glabel *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_LABEL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const glabel *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_LABEL;
 }
@@ -917,7 +1058,7 @@ is_a_helper <glabel *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gresx *>::test (gimple gs)
+is_a_helper <gresx *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_RESX;
 }
@@ -925,7 +1066,7 @@ is_a_helper <gresx *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <geh_dispatch *>::test (gimple gs)
+is_a_helper <geh_dispatch *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_EH_DISPATCH;
 }
@@ -933,7 +1074,15 @@ is_a_helper <geh_dispatch *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <geh_else *>::test (gimple gs)
+is_a_helper <geh_else *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_EH_ELSE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const geh_else *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_EH_ELSE;
 }
@@ -941,7 +1090,7 @@ is_a_helper <geh_else *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <geh_filter *>::test (gimple gs)
+is_a_helper <geh_filter *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_EH_FILTER;
 }
@@ -949,7 +1098,15 @@ is_a_helper <geh_filter *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <geh_mnt *>::test (gimple gs)
+is_a_helper <geh_mnt *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_EH_MUST_NOT_THROW;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const geh_mnt *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_EH_MUST_NOT_THROW;
 }
@@ -957,7 +1114,7 @@ is_a_helper <geh_mnt *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_atomic_load *>::test (gimple gs)
+is_a_helper <gomp_atomic_load *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
 }
@@ -965,7 +1122,7 @@ is_a_helper <gomp_atomic_load *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_atomic_store *>::test (gimple gs)
+is_a_helper <gomp_atomic_store *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_ATOMIC_STORE;
 }
@@ -973,7 +1130,7 @@ is_a_helper <gomp_atomic_store *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gimple_statement_omp_return *>::test (gimple gs)
+is_a_helper <gimple_statement_omp_return *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_RETURN;
 }
@@ -981,7 +1138,7 @@ is_a_helper <gimple_statement_omp_return *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_continue *>::test (gimple gs)
+is_a_helper <gomp_continue *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_CONTINUE;
 }
@@ -989,7 +1146,7 @@ is_a_helper <gomp_continue *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_critical *>::test (gimple gs)
+is_a_helper <gomp_critical *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_CRITICAL;
 }
@@ -997,7 +1154,23 @@ is_a_helper <gomp_critical *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_for *>::test (gimple gs)
+is_a_helper <gomp_ordered *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_OMP_ORDERED;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gomp_scan *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_OMP_SCAN;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gomp_for *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_FOR;
 }
@@ -1005,15 +1178,17 @@ is_a_helper <gomp_for *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gimple_statement_omp_taskreg *>::test (gimple gs)
+is_a_helper <gimple_statement_omp_taskreg *>::test (gimple *gs)
 {
-  return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK;
+  return (gs->code == GIMPLE_OMP_PARALLEL
+         || gs->code == GIMPLE_OMP_TASK
+         || gs->code == GIMPLE_OMP_TEAMS);
 }
 
 template <>
 template <>
 inline bool
-is_a_helper <gomp_parallel *>::test (gimple gs)
+is_a_helper <gomp_parallel *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_PARALLEL;
 }
@@ -1021,7 +1196,7 @@ is_a_helper <gomp_parallel *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_target *>::test (gimple gs)
+is_a_helper <gomp_target *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_TARGET;
 }
@@ -1029,7 +1204,7 @@ is_a_helper <gomp_target *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_sections *>::test (gimple gs)
+is_a_helper <gomp_sections *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_SECTIONS;
 }
@@ -1037,7 +1212,7 @@ is_a_helper <gomp_sections *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_single *>::test (gimple gs)
+is_a_helper <gomp_single *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_SINGLE;
 }
@@ -1045,7 +1220,7 @@ is_a_helper <gomp_single *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_teams *>::test (gimple gs)
+is_a_helper <gomp_teams *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_TEAMS;
 }
@@ -1053,7 +1228,7 @@ is_a_helper <gomp_teams *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gomp_task *>::test (gimple gs)
+is_a_helper <gomp_task *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_OMP_TASK;
 }
@@ -1061,7 +1236,7 @@ is_a_helper <gomp_task *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gphi *>::test (gimple gs)
+is_a_helper <gphi *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_PHI;
 }
@@ -1069,7 +1244,7 @@ is_a_helper <gphi *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <greturn *>::test (gimple gs)
+is_a_helper <greturn *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_RETURN;
 }
@@ -1077,7 +1252,15 @@ is_a_helper <greturn *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gswitch *>::test (gimple gs)
+is_a_helper <gswitch *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_SWITCH;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gswitch *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_SWITCH;
 }
@@ -1085,7 +1268,7 @@ is_a_helper <gswitch *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gtransaction *>::test (gimple gs)
+is_a_helper <gtransaction *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_TRANSACTION;
 }
@@ -1093,7 +1276,15 @@ is_a_helper <gtransaction *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gtry *>::test (gimple gs)
+is_a_helper <gtry *>::test (gimple *gs)
+{
+  return gs->code == GIMPLE_TRY;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gtry *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_TRY;
 }
@@ -1101,7 +1292,7 @@ is_a_helper <gtry *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gimple_statement_wce *>::test (gimple gs)
+is_a_helper <gimple_statement_wce *>::test (gimple *gs)
 {
   return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
 }
@@ -1109,7 +1300,7 @@ is_a_helper <gimple_statement_wce *>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gasm *>::test (const_gimple gs)
+is_a_helper <const gasm *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_ASM;
 }
@@ -1117,7 +1308,7 @@ is_a_helper <const gasm *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gbind *>::test (const_gimple gs)
+is_a_helper <const gbind *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_BIND;
 }
@@ -1125,7 +1316,7 @@ is_a_helper <const gbind *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gcall *>::test (const_gimple gs)
+is_a_helper <const gcall *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_CALL;
 }
@@ -1133,7 +1324,7 @@ is_a_helper <const gcall *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gcatch *>::test (const_gimple gs)
+is_a_helper <const gcatch *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_CATCH;
 }
@@ -1141,7 +1332,7 @@ is_a_helper <const gcatch *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gresx *>::test (const_gimple gs)
+is_a_helper <const gresx *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_RESX;
 }
@@ -1149,7 +1340,7 @@ is_a_helper <const gresx *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const geh_dispatch *>::test (const_gimple gs)
+is_a_helper <const geh_dispatch *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_EH_DISPATCH;
 }
@@ -1157,7 +1348,7 @@ is_a_helper <const geh_dispatch *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const geh_filter *>::test (const_gimple gs)
+is_a_helper <const geh_filter *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_EH_FILTER;
 }
@@ -1165,7 +1356,7 @@ is_a_helper <const geh_filter *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_atomic_load *>::test (const_gimple gs)
+is_a_helper <const gomp_atomic_load *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
 }
@@ -1173,7 +1364,7 @@ is_a_helper <const gomp_atomic_load *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_atomic_store *>::test (const_gimple gs)
+is_a_helper <const gomp_atomic_store *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_ATOMIC_STORE;
 }
@@ -1181,7 +1372,7 @@ is_a_helper <const gomp_atomic_store *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gimple_statement_omp_return *>::test (const_gimple gs)
+is_a_helper <const gimple_statement_omp_return *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_RETURN;
 }
@@ -1189,7 +1380,7 @@ is_a_helper <const gimple_statement_omp_return *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_continue *>::test (const_gimple gs)
+is_a_helper <const gomp_continue *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_CONTINUE;
 }
@@ -1197,7 +1388,7 @@ is_a_helper <const gomp_continue *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_critical *>::test (const_gimple gs)
+is_a_helper <const gomp_critical *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_CRITICAL;
 }
@@ -1205,7 +1396,23 @@ is_a_helper <const gomp_critical *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_for *>::test (const_gimple gs)
+is_a_helper <const gomp_ordered *>::test (const gimple *gs)
+{
+  return gs->code == GIMPLE_OMP_ORDERED;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gomp_scan *>::test (const gimple *gs)
+{
+  return gs->code == GIMPLE_OMP_SCAN;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gomp_for *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_FOR;
 }
@@ -1213,15 +1420,17 @@ is_a_helper <const gomp_for *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gimple_statement_omp_taskreg *>::test (const_gimple gs)
+is_a_helper <const gimple_statement_omp_taskreg *>::test (const gimple *gs)
 {
-  return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK;
+  return (gs->code == GIMPLE_OMP_PARALLEL
+         || gs->code == GIMPLE_OMP_TASK
+         || gs->code == GIMPLE_OMP_TEAMS);
 }
 
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_parallel *>::test (const_gimple gs)
+is_a_helper <const gomp_parallel *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_PARALLEL;
 }
@@ -1229,7 +1438,7 @@ is_a_helper <const gomp_parallel *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_target *>::test (const_gimple gs)
+is_a_helper <const gomp_target *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_TARGET;
 }
@@ -1237,7 +1446,7 @@ is_a_helper <const gomp_target *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_sections *>::test (const_gimple gs)
+is_a_helper <const gomp_sections *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_SECTIONS;
 }
@@ -1245,7 +1454,7 @@ is_a_helper <const gomp_sections *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_single *>::test (const_gimple gs)
+is_a_helper <const gomp_single *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_SINGLE;
 }
@@ -1253,7 +1462,7 @@ is_a_helper <const gomp_single *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_teams *>::test (const_gimple gs)
+is_a_helper <const gomp_teams *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_TEAMS;
 }
@@ -1261,7 +1470,7 @@ is_a_helper <const gomp_teams *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gomp_task *>::test (const_gimple gs)
+is_a_helper <const gomp_task *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_OMP_TASK;
 }
@@ -1269,7 +1478,7 @@ is_a_helper <const gomp_task *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gphi *>::test (const_gimple gs)
+is_a_helper <const gphi *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_PHI;
 }
@@ -1277,7 +1486,15 @@ is_a_helper <const gphi *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gtransaction *>::test (const_gimple gs)
+is_a_helper <const greturn *>::test (const gimple *gs)
+{
+  return gs->code == GIMPLE_RETURN;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gtransaction *>::test (const gimple *gs)
 {
   return gs->code == GIMPLE_TRANSACTION;
 }
@@ -1291,10 +1508,11 @@ extern enum gimple_statement_structure_enum const gss_for_code_[];
 
 /* This variable holds the currently expanded gimple statement for purposes
    of comminucating the profile info to the builtin expanders.  */
-extern gimple currently_expanding_gimple_stmt;
+extern gimple *currently_expanding_gimple_stmt;
 
-#define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
-gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
+size_t gimple_size (enum gimple_code code, unsigned num_ops = 0);
+void gimple_init (gimple *g, enum gimple_code code, unsigned num_ops);
+gimple *gimple_alloc (enum gimple_code, unsigned CXX_MEM_STAT_INFO);
 greturn *gimple_build_return (tree);
 void gimple_call_reset_alias_info (gcall *);
 gcall *gimple_build_call_vec (tree, vec<tree> );
@@ -1302,8 +1520,8 @@ gcall *gimple_build_call (tree, unsigned, ...);
 gcall *gimple_build_call_valist (tree, unsigned, va_list);
 gcall *gimple_build_call_internal (enum internal_fn, unsigned, ...);
 gcall *gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
-gcall *gimple_build_call_from_tree (tree);
-gassign *gimple_build_assign (tree, tree CXX_MEM_STAT_DECL);
+gcall *gimple_build_call_from_tree (tree, tree);
+gassign *gimple_build_assign (tree, tree CXX_MEM_STAT_INFO);
 gassign *gimple_build_assign (tree, enum tree_code,
                              tree, tree, tree CXX_MEM_STAT_INFO);
 gassign *gimple_build_assign (tree, enum tree_code,
@@ -1314,7 +1532,7 @@ gcond *gimple_build_cond_from_tree (tree, tree, tree);
 void gimple_cond_set_condition_from_tree (gcond *, tree);
 glabel *gimple_build_label (tree label);
 ggoto *gimple_build_goto (tree dest);
-gimple gimple_build_nop (void);
+gimple *gimple_build_nop (void);
 gbind *gimple_build_bind (tree, gimple_seq, tree);
 gasm *gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
                                 vec<tree, va_gc> *, vec<tree, va_gc> *,
@@ -1325,39 +1543,39 @@ geh_mnt *gimple_build_eh_must_not_throw (tree);
 geh_else *gimple_build_eh_else (gimple_seq, gimple_seq);
 gtry *gimple_build_try (gimple_seq, gimple_seq,
                                        enum gimple_try_flags);
-gimple gimple_build_wce (gimple_seq);
+gimple *gimple_build_wce (gimple_seq);
 gresx *gimple_build_resx (int);
 gswitch *gimple_build_switch_nlabels (unsigned, tree, tree);
 gswitch *gimple_build_switch (tree, tree, vec<tree> );
 geh_dispatch *gimple_build_eh_dispatch (int);
-gdebug *gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
-#define gimple_build_debug_bind(var,val,stmt)                  \
-  gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
-gdebug *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)
-gomp_critical *gimple_build_omp_critical (gimple_seq, tree);
+gdebug *gimple_build_debug_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
+gdebug *gimple_build_debug_source_bind (tree, tree, gimple * CXX_MEM_STAT_INFO);
+gdebug *gimple_build_debug_begin_stmt (tree, location_t CXX_MEM_STAT_INFO);
+gdebug *gimple_build_debug_inline_entry (tree, location_t CXX_MEM_STAT_INFO);
+gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
 gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
 gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
 gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
                                       tree, tree);
-gimple gimple_build_omp_section (gimple_seq);
-gimple gimple_build_omp_master (gimple_seq);
-gimple gimple_build_omp_taskgroup (gimple_seq);
+gimple *gimple_build_omp_section (gimple_seq);
+gimple *gimple_build_omp_master (gimple_seq);
+gimple *gimple_build_omp_grid_body (gimple_seq);
+gimple *gimple_build_omp_taskgroup (gimple_seq, tree);
 gomp_continue *gimple_build_omp_continue (tree, tree);
-gimple gimple_build_omp_ordered (gimple_seq);
-gimple gimple_build_omp_return (bool);
+gomp_ordered *gimple_build_omp_ordered (gimple_seq, tree);
+gimple *gimple_build_omp_return (bool);
+gomp_scan *gimple_build_omp_scan (gimple_seq, tree);
 gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
-gimple gimple_build_omp_sections_switch (void);
+gimple *gimple_build_omp_sections_switch (void);
 gomp_single *gimple_build_omp_single (gimple_seq, tree);
 gomp_target *gimple_build_omp_target (gimple_seq, int, tree);
 gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
-gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree);
-gomp_atomic_store *gimple_build_omp_atomic_store (tree);
-gtransaction *gimple_build_transaction (gimple_seq, tree);
-gimple gimple_build_predict (enum br_predictor, enum prediction);
-extern void gimple_seq_add_stmt (gimple_seq *, gimple);
-extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
+gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree,
+                                               enum omp_memory_order);
+gomp_atomic_store *gimple_build_omp_atomic_store (tree, enum omp_memory_order);
+gtransaction *gimple_build_transaction (gimple_seq);
+extern void gimple_seq_add_stmt (gimple_seq *, gimple *);
+extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple *);
 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
 void gimple_seq_add_seq_without_update (gimple_seq *, gimple_seq);
 extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
@@ -1365,24 +1583,27 @@ extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
 extern void annotate_all_with_location (gimple_seq, location_t);
 bool empty_body_p (gimple_seq);
 gimple_seq gimple_seq_copy (gimple_seq);
-bool gimple_call_same_target_p (const_gimple, const_gimple);
-int gimple_call_flags (const_gimple);
+bool gimple_call_same_target_p (const gimple *, const gimple *);
+int gimple_call_flags (const gimple *);
 int gimple_call_arg_flags (const gcall *, unsigned);
 int gimple_call_return_flags (const gcall *);
-bool gimple_assign_copy_p (gimple);
-bool gimple_assign_ssa_name_copy_p (gimple);
-bool gimple_assign_unary_nop_p (gimple);
-void gimple_set_bb (gimple, basic_block);
+bool gimple_call_nonnull_result_p (gcall *);
+tree gimple_call_nonnull_arg (gcall *);
+bool gimple_assign_copy_p (gimple *);
+bool gimple_assign_ssa_name_copy_p (gimple *);
+bool gimple_assign_unary_nop_p (gimple *);
+void gimple_set_bb (gimple *, basic_block);
 void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
 void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
                                     tree, tree, tree);
-tree gimple_get_lhs (const_gimple);
-void gimple_set_lhs (gimple, tree);
-gimple gimple_copy (gimple);
-bool gimple_has_side_effects (const_gimple);
-bool gimple_could_trap_p_1 (gimple, bool, bool);
-bool gimple_could_trap_p (gimple);
-bool gimple_assign_rhs_could_trap_p (gimple);
+tree gimple_get_lhs (const gimple *);
+void gimple_set_lhs (gimple *, tree);
+gimple *gimple_copy (gimple *);
+void gimple_move_vops (gimple *, gimple *);
+bool gimple_has_side_effects (const gimple *);
+bool gimple_could_trap_p_1 (gimple *, bool, bool);
+bool gimple_could_trap_p (gimple *);
+bool gimple_assign_rhs_could_trap_p (gimple *);
 extern void dump_gimple_statistics (void);
 unsigned get_gimple_rhs_num_ops (enum tree_code);
 extern tree canonicalize_cond_expr_cond (tree);
@@ -1391,20 +1612,29 @@ extern bool gimple_compare_field_offset (tree, tree);
 extern tree gimple_unsigned_type (tree);
 extern tree gimple_signed_type (tree);
 extern alias_set_type gimple_get_alias_set (tree);
-extern bool gimple_ior_addresses_taken (bitmap, gimple);
-extern bool gimple_builtin_call_types_compatible_p (const_gimple, tree);
-extern bool gimple_call_builtin_p (const_gimple);
-extern bool gimple_call_builtin_p (const_gimple, enum built_in_class);
-extern bool gimple_call_builtin_p (const_gimple, enum built_in_function);
+extern bool gimple_ior_addresses_taken (bitmap, gimple *);
+extern bool gimple_builtin_call_types_compatible_p (const gimple *, tree);
+extern combined_fn gimple_call_combined_fn (const gimple *);
+extern bool gimple_call_replaceable_operator_delete_p (const gcall *);
+extern bool gimple_call_builtin_p (const gimple *);
+extern bool gimple_call_builtin_p (const gimple *, enum built_in_class);
+extern bool gimple_call_builtin_p (const gimple *, enum built_in_function);
 extern bool gimple_asm_clobbers_memory_p (const gasm *);
 extern void dump_decl_set (FILE *, bitmap);
-extern bool nonfreeing_call_p (gimple);
-extern bool infer_nonnull_range (gimple, tree, bool, bool);
+extern bool nonfreeing_call_p (gimple *);
+extern bool nonbarrier_call_p (gimple *);
+extern bool infer_nonnull_range (gimple *, tree);
+extern bool infer_nonnull_range_by_dereference (gimple *, tree);
+extern bool infer_nonnull_range_by_attribute (gimple *, tree);
 extern void sort_case_labels (vec<tree>);
 extern void preprocess_case_label_vec_for_gimple (vec<tree>, tree, tree *);
 extern void gimple_seq_set_location (gimple_seq, location_t);
 extern void gimple_seq_discard (gimple_seq);
-extern void maybe_remove_unused_call_args (struct function *, gimple);
+extern void maybe_remove_unused_call_args (struct function *, gimple *);
+extern bool gimple_inexpensive_call_p (gcall *);
+extern bool stmt_can_terminate_bb_p (gimple *);
+extern location_t gimple_or_expr_nonartificial_location (gimple *, tree);
+
 
 /* Formal (expression) temporary table handling: multiple occurrences of
    the same scalar expression are evaluated into the same temporary.  */
@@ -1447,7 +1677,7 @@ gimple_seq_first (gimple_seq s)
 
 /* Return the first statement in GIMPLE sequence S.  */
 
-static inline gimple
+static inline gimple *
 gimple_seq_first_stmt (gimple_seq s)
 {
   gimple_seq_node n = gimple_seq_first (s);
@@ -1476,7 +1706,7 @@ gimple_seq_last (gimple_seq s)
 
 /* Return the last statement in GIMPLE sequence S.  */
 
-static inline gimple
+static inline gimple *
 gimple_seq_last_stmt (gimple_seq s)
 {
   gimple_seq_node n = gimple_seq_last (s);
@@ -1513,7 +1743,7 @@ gimple_seq_empty_p (gimple_seq s)
 /* Allocate a new sequence and initialize its first element with STMT.  */
 
 static inline gimple_seq
-gimple_seq_alloc_with_stmt (gimple stmt)
+gimple_seq_alloc_with_stmt (gimple *stmt)
 {
   gimple_seq seq = NULL;
   gimple_seq_add_stmt (&seq, stmt);
@@ -1548,7 +1778,7 @@ set_bb_seq (basic_block bb, gimple_seq seq)
 /* Return the code for GIMPLE statement G.  */
 
 static inline enum gimple_code
-gimple_code (const_gimple g)
+gimple_code (const gimple *g)
 {
   return g->code;
 }
@@ -1567,7 +1797,7 @@ gss_for_code (enum gimple_code code)
 /* Return which GSS code is used by GS.  */
 
 static inline enum gimple_statement_structure_enum
-gimple_statement_structure (gimple gs)
+gimple_statement_structure (gimple *gs)
 {
   return gss_for_code (gimple_code (gs));
 }
@@ -1577,7 +1807,7 @@ gimple_statement_structure (gimple gs)
    High GIMPLE statements.  */
 
 static inline bool
-gimple_has_substatements (gimple g)
+gimple_has_substatements (gimple *g)
 {
   switch (gimple_code (g))
     {
@@ -1600,6 +1830,7 @@ gimple_has_substatements (gimple g)
     case GIMPLE_OMP_CRITICAL:
     case GIMPLE_WITH_CLEANUP_EXPR:
     case GIMPLE_TRANSACTION:
+    case GIMPLE_OMP_GRID_BODY:
       return true;
 
     default:
@@ -1611,7 +1842,7 @@ gimple_has_substatements (gimple g)
 /* Return the basic block holding statement G.  */
 
 static inline basic_block
-gimple_bb (const_gimple g)
+gimple_bb (const gimple *g)
 {
   return g->bb;
 }
@@ -1620,7 +1851,7 @@ gimple_bb (const_gimple g)
 /* Return the lexical scope block holding statement G.  */
 
 static inline tree
-gimple_block (const_gimple g)
+gimple_block (const gimple *g)
 {
   return LOCATION_BLOCK (g->location);
 }
@@ -1629,20 +1860,16 @@ gimple_block (const_gimple g)
 /* Set BLOCK to be the lexical scope block holding statement G.  */
 
 static inline void
-gimple_set_block (gimple g, tree block)
+gimple_set_block (gimple *g, tree block)
 {
-  if (block)
-    g->location =
-       COMBINE_LOCATION_DATA (line_table, g->location, block);
-  else
-    g->location = LOCATION_LOCUS (g->location);
+  g->location = set_block (g->location, block);
 }
 
 
 /* Return location information for statement G.  */
 
 static inline location_t
-gimple_location (const_gimple g)
+gimple_location (const gimple *g)
 {
   return g->location;
 }
@@ -1651,24 +1878,15 @@ gimple_location (const_gimple g)
    Otherwise, UNKNOWN_LOCATION is returned.  */
 
 static inline location_t
-gimple_location_safe (const_gimple g)
+gimple_location_safe (const gimple *g)
 {
   return g ? gimple_location (g) : UNKNOWN_LOCATION;
 }
 
-/* Return pointer to location information for statement G.  */
-
-static inline const location_t *
-gimple_location_ptr (const_gimple g)
-{
-  return &g->location;
-}
-
-
 /* Set location information for statement G.  */
 
 static inline void
-gimple_set_location (gimple g, location_t location)
+gimple_set_location (gimple *g, location_t location)
 {
   g->location = location;
 }
@@ -1677,16 +1895,30 @@ gimple_set_location (gimple g, location_t location)
 /* Return true if G contains location information.  */
 
 static inline bool
-gimple_has_location (const_gimple g)
+gimple_has_location (const gimple *g)
 {
   return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
 }
 
 
+/* Return non-artificial location information for statement G.  */
+
+static inline location_t
+gimple_nonartificial_location (const gimple *g)
+{
+  location_t *ploc = NULL;
+
+  if (tree block = gimple_block (g))
+    ploc = block_nonartificial_location (block);
+
+  return ploc ? *ploc : gimple_location (g);
+}
+
+
 /* Return the file name of the location of STMT.  */
 
 static inline const char *
-gimple_filename (const_gimple stmt)
+gimple_filename (const gimple *stmt)
 {
   return LOCATION_FILE (gimple_location (stmt));
 }
@@ -1695,7 +1927,7 @@ gimple_filename (const_gimple stmt)
 /* Return the line number of the location of STMT.  */
 
 static inline int
-gimple_lineno (const_gimple stmt)
+gimple_lineno (const gimple *stmt)
 {
   return LOCATION_LINE (gimple_location (stmt));
 }
@@ -1713,7 +1945,7 @@ gimple_seq_singleton_p (gimple_seq seq)
 /* Return true if no warnings should be emitted for statement STMT.  */
 
 static inline bool
-gimple_no_warning_p (const_gimple stmt)
+gimple_no_warning_p (const gimple *stmt)
 {
   return stmt->no_warning;
 }
@@ -1721,7 +1953,7 @@ gimple_no_warning_p (const_gimple stmt)
 /* Set the no_warning flag of STMT to NO_WARNING.  */
 
 static inline void
-gimple_set_no_warning (gimple stmt, bool no_warning)
+gimple_set_no_warning (gimple *stmt, bool no_warning)
 {
   stmt->no_warning = (unsigned) no_warning;
 }
@@ -1735,11 +1967,11 @@ gimple_set_no_warning (gimple stmt, bool no_warning)
 
    You can learn more about the visited property of the gimple
    statement by reading the comments of the 'visited' data member of
-   struct gimple statement_base.
+   struct gimple.
  */
 
 static inline void
-gimple_set_visited (gimple stmt, bool visited_p)
+gimple_set_visited (gimple *stmt, bool visited_p)
 {
   stmt->visited = (unsigned) visited_p;
 }
@@ -1754,10 +1986,10 @@ gimple_set_visited (gimple stmt, bool visited_p)
 
    You can learn more about the visited property of the gimple
    statement by reading the comments of the 'visited' data member of
-   struct gimple statement_base.  */
+   struct gimple.  */
 
 static inline bool
-gimple_visited_p (gimple stmt)
+gimple_visited_p (gimple *stmt)
 {
   return stmt->visited;
 }
@@ -1774,7 +2006,7 @@ gimple_visited_p (gimple stmt)
    the 'plf' data member of struct gimple_statement_structure.  */
 
 static inline void
-gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
+gimple_set_plf (gimple *stmt, enum plf_mask plf, bool val_p)
 {
   if (val_p)
     stmt->plf |= (unsigned int) plf;
@@ -1794,7 +2026,7 @@ gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
    the 'plf' data member of struct gimple_statement_structure.  */
 
 static inline unsigned int
-gimple_plf (gimple stmt, enum plf_mask plf)
+gimple_plf (gimple *stmt, enum plf_mask plf)
 {
   return stmt->plf & ((unsigned int) plf);
 }
@@ -1808,7 +2040,7 @@ gimple_plf (gimple stmt, enum plf_mask plf)
    to any value it sees fit.  */
 
 static inline void
-gimple_set_uid (gimple g, unsigned uid)
+gimple_set_uid (gimple *g, unsigned uid)
 {
   g->uid = uid;
 }
@@ -1822,7 +2054,7 @@ gimple_set_uid (gimple g, unsigned uid)
    to any value it sees fit.  */
 
 static inline unsigned
-gimple_uid (const_gimple g)
+gimple_uid (const gimple *g)
 {
   return g->uid;
 }
@@ -1831,7 +2063,7 @@ gimple_uid (const_gimple g)
 /* Make statement G a singleton sequence.  */
 
 static inline void
-gimple_init_singleton (gimple g)
+gimple_init_singleton (gimple *g)
 {
   g->next = NULL;
   g->prev = g;
@@ -1841,7 +2073,7 @@ gimple_init_singleton (gimple g)
 /* Return true if GIMPLE statement G has register or memory operands.  */
 
 static inline bool
-gimple_has_ops (const_gimple g)
+gimple_has_ops (const gimple *g)
 {
   return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
 }
@@ -1849,7 +2081,7 @@ gimple_has_ops (const_gimple g)
 template <>
 template <>
 inline bool
-is_a_helper <const gimple_statement_with_ops *>::test (const_gimple gs)
+is_a_helper <const gimple_statement_with_ops *>::test (const gimple *gs)
 {
   return gimple_has_ops (gs);
 }
@@ -1857,7 +2089,7 @@ is_a_helper <const gimple_statement_with_ops *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gimple_statement_with_ops *>::test (gimple gs)
+is_a_helper <gimple_statement_with_ops *>::test (gimple *gs)
 {
   return gimple_has_ops (gs);
 }
@@ -1865,7 +2097,7 @@ is_a_helper <gimple_statement_with_ops *>::test (gimple gs)
 /* Return true if GIMPLE statement G has memory operands.  */
 
 static inline bool
-gimple_has_mem_ops (const_gimple g)
+gimple_has_mem_ops (const gimple *g)
 {
   return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
 }
@@ -1873,7 +2105,7 @@ gimple_has_mem_ops (const_gimple g)
 template <>
 template <>
 inline bool
-is_a_helper <const gimple_statement_with_memory_ops *>::test (const_gimple gs)
+is_a_helper <const gimple_statement_with_memory_ops *>::test (const gimple *gs)
 {
   return gimple_has_mem_ops (gs);
 }
@@ -1881,7 +2113,7 @@ is_a_helper <const gimple_statement_with_memory_ops *>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gimple_statement_with_memory_ops *>::test (gimple gs)
+is_a_helper <gimple_statement_with_memory_ops *>::test (gimple *gs)
 {
   return gimple_has_mem_ops (gs);
 }
@@ -1889,7 +2121,7 @@ is_a_helper <gimple_statement_with_memory_ops *>::test (gimple gs)
 /* Return the set of USE operands for statement G.  */
 
 static inline struct use_optype_d *
-gimple_use_ops (const_gimple g)
+gimple_use_ops (const gimple *g)
 {
   const gimple_statement_with_ops *ops_stmt =
     dyn_cast <const gimple_statement_with_ops *> (g);
@@ -1902,7 +2134,7 @@ gimple_use_ops (const_gimple g)
 /* Set USE to be the set of USE operands for statement G.  */
 
 static inline void
-gimple_set_use_ops (gimple g, struct use_optype_d *use)
+gimple_set_use_ops (gimple *g, struct use_optype_d *use)
 {
   gimple_statement_with_ops *ops_stmt =
     as_a <gimple_statement_with_ops *> (g);
@@ -1913,7 +2145,7 @@ gimple_set_use_ops (gimple g, struct use_optype_d *use)
 /* Return the single VUSE operand of the statement G.  */
 
 static inline tree
-gimple_vuse (const_gimple g)
+gimple_vuse (const gimple *g)
 {
   const gimple_statement_with_memory_ops *mem_ops_stmt =
      dyn_cast <const gimple_statement_with_memory_ops *> (g);
@@ -1925,7 +2157,7 @@ gimple_vuse (const_gimple g)
 /* Return the single VDEF operand of the statement G.  */
 
 static inline tree
-gimple_vdef (const_gimple g)
+gimple_vdef (const gimple *g)
 {
   const gimple_statement_with_memory_ops *mem_ops_stmt =
      dyn_cast <const gimple_statement_with_memory_ops *> (g);
@@ -1937,7 +2169,7 @@ gimple_vdef (const_gimple g)
 /* Return the single VUSE operand of the statement G.  */
 
 static inline tree *
-gimple_vuse_ptr (gimple g)
+gimple_vuse_ptr (gimple *g)
 {
   gimple_statement_with_memory_ops *mem_ops_stmt =
      dyn_cast <gimple_statement_with_memory_ops *> (g);
@@ -1949,7 +2181,7 @@ gimple_vuse_ptr (gimple g)
 /* Return the single VDEF operand of the statement G.  */
 
 static inline tree *
-gimple_vdef_ptr (gimple g)
+gimple_vdef_ptr (gimple *g)
 {
   gimple_statement_with_memory_ops *mem_ops_stmt =
      dyn_cast <gimple_statement_with_memory_ops *> (g);
@@ -1961,7 +2193,7 @@ gimple_vdef_ptr (gimple g)
 /* Set the single VUSE operand of the statement G.  */
 
 static inline void
-gimple_set_vuse (gimple g, tree vuse)
+gimple_set_vuse (gimple *g, tree vuse)
 {
   gimple_statement_with_memory_ops *mem_ops_stmt =
     as_a <gimple_statement_with_memory_ops *> (g);
@@ -1971,7 +2203,7 @@ gimple_set_vuse (gimple g, tree vuse)
 /* Set the single VDEF operand of the statement G.  */
 
 static inline void
-gimple_set_vdef (gimple g, tree vdef)
+gimple_set_vdef (gimple *g, tree vdef)
 {
   gimple_statement_with_memory_ops *mem_ops_stmt =
     as_a <gimple_statement_with_memory_ops *> (g);
@@ -1983,7 +2215,7 @@ gimple_set_vdef (gimple g, tree vdef)
    been set.  */
 
 static inline bool
-gimple_modified_p (const_gimple g)
+gimple_modified_p (const gimple *g)
 {
   return (gimple_has_ops (g)) ? (bool) g->modified : false;
 }
@@ -1993,7 +2225,7 @@ gimple_modified_p (const_gimple g)
    a MODIFIED field.  */
 
 static inline void
-gimple_set_modified (gimple s, bool modifiedp)
+gimple_set_modified (gimple *s, bool modifiedp)
 {
   if (gimple_has_ops (s))
     s->modified = (unsigned) modifiedp;
@@ -2007,7 +2239,7 @@ gimple_set_modified (gimple s, bool modifiedp)
    three kinds of computation that GIMPLE supports.  */
 
 static inline enum tree_code
-gimple_expr_code (const_gimple stmt)
+gimple_expr_code (const gimple *stmt)
 {
   enum gimple_code code = gimple_code (stmt);
   if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
@@ -2023,7 +2255,7 @@ gimple_expr_code (const_gimple stmt)
 /* Return true if statement STMT contains volatile operands.  */
 
 static inline bool
-gimple_has_volatile_ops (const_gimple stmt)
+gimple_has_volatile_ops (const gimple *stmt)
 {
   if (gimple_has_mem_ops (stmt))
     return stmt->has_volatile_ops;
@@ -2035,7 +2267,7 @@ gimple_has_volatile_ops (const_gimple stmt)
 /* Set the HAS_VOLATILE_OPS flag to VOLATILEP.  */
 
 static inline void
-gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
+gimple_set_has_volatile_ops (gimple *stmt, bool volatilep)
 {
   if (gimple_has_mem_ops (stmt))
     stmt->has_volatile_ops = (unsigned) volatilep;
@@ -2044,7 +2276,7 @@ gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
 /* Return true if STMT is in a transaction.  */
 
 static inline bool
-gimple_in_transaction (gimple stmt)
+gimple_in_transaction (const gimple *stmt)
 {
   return bb_in_transaction (gimple_bb (stmt));
 }
@@ -2052,7 +2284,7 @@ gimple_in_transaction (gimple stmt)
 /* Return true if statement STMT may access memory.  */
 
 static inline bool
-gimple_references_memory_p (gimple stmt)
+gimple_references_memory_p (gimple *stmt)
 {
   return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
 }
@@ -2061,17 +2293,17 @@ gimple_references_memory_p (gimple stmt)
 /* Return the subcode for OMP statement S.  */
 
 static inline unsigned
-gimple_omp_subcode (const_gimple s)
+gimple_omp_subcode (const gimple *s)
 {
   gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
-             && gimple_code (s) <= GIMPLE_OMP_TEAMS);
+                             && gimple_code (s) <= GIMPLE_OMP_TEAMS);
   return s->subcode;
 }
 
 /* Set the subcode for OMP statement S to SUBCODE.  */
 
 static inline void
-gimple_omp_set_subcode (gimple s, unsigned int subcode)
+gimple_omp_set_subcode (gimple *s, unsigned int subcode)
 {
   /* We only have 16 bits for the subcode.  Assert that we are not
      overflowing it.  */
@@ -2082,7 +2314,7 @@ gimple_omp_set_subcode (gimple s, unsigned int subcode)
 /* Set the nowait flag on OMP_RETURN statement S.  */
 
 static inline void
-gimple_omp_return_set_nowait (gimple s)
+gimple_omp_return_set_nowait (gimple *s)
 {
   GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
   s->subcode |= GF_OMP_RETURN_NOWAIT;
@@ -2093,7 +2325,7 @@ gimple_omp_return_set_nowait (gimple s)
    flag set.  */
 
 static inline bool
-gimple_omp_return_nowait_p (const_gimple g)
+gimple_omp_return_nowait_p (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
   return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
@@ -2103,7 +2335,7 @@ gimple_omp_return_nowait_p (const_gimple g)
 /* Set the LHS of OMP return.  */
 
 static inline void
-gimple_omp_return_set_lhs (gimple g, tree lhs)
+gimple_omp_return_set_lhs (gimple *g, tree lhs)
 {
   gimple_statement_omp_return *omp_return_stmt =
     as_a <gimple_statement_omp_return *> (g);
@@ -2114,7 +2346,7 @@ gimple_omp_return_set_lhs (gimple g, tree lhs)
 /* Get the LHS of OMP return.  */
 
 static inline tree
-gimple_omp_return_lhs (const_gimple g)
+gimple_omp_return_lhs (const gimple *g)
 {
   const gimple_statement_omp_return *omp_return_stmt =
     as_a <const gimple_statement_omp_return *> (g);
@@ -2125,7 +2357,7 @@ gimple_omp_return_lhs (const_gimple g)
 /* Return a pointer to the LHS of OMP return.  */
 
 static inline tree *
-gimple_omp_return_lhs_ptr (gimple g)
+gimple_omp_return_lhs_ptr (gimple *g)
 {
   gimple_statement_omp_return *omp_return_stmt =
     as_a <gimple_statement_omp_return *> (g);
@@ -2137,7 +2369,7 @@ gimple_omp_return_lhs_ptr (gimple g)
    flag set.  */
 
 static inline bool
-gimple_omp_section_last_p (const_gimple g)
+gimple_omp_section_last_p (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
   return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
@@ -2147,7 +2379,7 @@ gimple_omp_section_last_p (const_gimple g)
 /* Set the GF_OMP_SECTION_LAST flag on G.  */
 
 static inline void
-gimple_omp_section_set_last (gimple g)
+gimple_omp_section_set_last (gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
   g->subcode |= GF_OMP_SECTION_LAST;
@@ -2158,7 +2390,7 @@ gimple_omp_section_set_last (gimple g)
    GF_OMP_PARALLEL_COMBINED flag set.  */
 
 static inline bool
-gimple_omp_parallel_combined_p (const_gimple g)
+gimple_omp_parallel_combined_p (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
   return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
@@ -2169,7 +2401,7 @@ gimple_omp_parallel_combined_p (const_gimple g)
    value of COMBINED_P.  */
 
 static inline void
-gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
+gimple_omp_parallel_set_combined_p (gimple *g, bool combined_p)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
   if (combined_p)
@@ -2183,7 +2415,7 @@ gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
    GF_OMP_ATOMIC_NEED_VALUE flag set.  */
 
 static inline bool
-gimple_omp_atomic_need_value_p (const_gimple g)
+gimple_omp_atomic_need_value_p (const gimple *g)
 {
   if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
     GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
@@ -2194,7 +2426,7 @@ gimple_omp_atomic_need_value_p (const_gimple g)
 /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G.  */
 
 static inline void
-gimple_omp_atomic_set_need_value (gimple g)
+gimple_omp_atomic_set_need_value (gimple *g)
 {
   if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
     GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
@@ -2202,33 +2434,34 @@ gimple_omp_atomic_set_need_value (gimple g)
 }
 
 
-/* Return true if OMP atomic load/store statement G has the
-   GF_OMP_ATOMIC_SEQ_CST flag set.  */
+/* Return the memory order of the OMP atomic load/store statement G.  */
 
-static inline bool
-gimple_omp_atomic_seq_cst_p (const_gimple g)
+static inline enum omp_memory_order
+gimple_omp_atomic_memory_order (const gimple *g)
 {
   if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
     GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
-  return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_SEQ_CST) != 0;
+  return (enum omp_memory_order)
+        (gimple_omp_subcode (g) & GF_OMP_ATOMIC_MEMORY_ORDER);
 }
 
 
-/* Set the GF_OMP_ATOMIC_SEQ_CST flag on G.  */
+/* Set the memory order on G.  */
 
 static inline void
-gimple_omp_atomic_set_seq_cst (gimple g)
+gimple_omp_atomic_set_memory_order (gimple *g, enum omp_memory_order mo)
 {
   if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
     GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
-  g->subcode |= GF_OMP_ATOMIC_SEQ_CST;
+  g->subcode = ((g->subcode & ~GF_OMP_ATOMIC_MEMORY_ORDER)
+               | (mo & GF_OMP_ATOMIC_MEMORY_ORDER));
 }
 
 
 /* Return the number of operands for statement GS.  */
 
 static inline unsigned
-gimple_num_ops (const_gimple gs)
+gimple_num_ops (const gimple *gs)
 {
   return gs->num_ops;
 }
@@ -2237,7 +2470,7 @@ gimple_num_ops (const_gimple gs)
 /* Set the number of operands for statement GS.  */
 
 static inline void
-gimple_set_num_ops (gimple gs, unsigned num_ops)
+gimple_set_num_ops (gimple *gs, unsigned num_ops)
 {
   gs->num_ops = num_ops;
 }
@@ -2246,7 +2479,7 @@ gimple_set_num_ops (gimple gs, unsigned num_ops)
 /* Return the array of operands for statement GS.  */
 
 static inline tree *
-gimple_ops (gimple gs)
+gimple_ops (gimple *gs)
 {
   size_t off;
 
@@ -2263,7 +2496,7 @@ gimple_ops (gimple gs)
 /* Return operand I for statement GS.  */
 
 static inline tree
-gimple_op (const_gimple gs, unsigned i)
+gimple_op (const gimple *gs, unsigned i)
 {
   if (gimple_has_ops (gs))
     {
@@ -2277,12 +2510,12 @@ gimple_op (const_gimple gs, unsigned i)
 /* Return a pointer to operand I for statement GS.  */
 
 static inline tree *
-gimple_op_ptr (const_gimple gs, unsigned i)
+gimple_op_ptr (gimple *gs, unsigned i)
 {
   if (gimple_has_ops (gs))
     {
       gcc_gimple_checking_assert (i < gimple_num_ops (gs));
-      return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
+      return gimple_ops (gs) + i;
     }
   else
     return NULL;
@@ -2291,7 +2524,7 @@ gimple_op_ptr (const_gimple gs, unsigned i)
 /* Set operand I of statement GS to OP.  */
 
 static inline void
-gimple_set_op (gimple gs, unsigned i, tree op)
+gimple_set_op (gimple *gs, unsigned i, tree op)
 {
   gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
 
@@ -2305,7 +2538,7 @@ gimple_set_op (gimple gs, unsigned i, tree op)
 /* Return true if GS is a GIMPLE_ASSIGN.  */
 
 static inline bool
-is_gimple_assign (const_gimple gs)
+is_gimple_assign (const gimple *gs)
 {
   return gimple_code (gs) == GIMPLE_ASSIGN;
 }
@@ -2322,43 +2555,67 @@ get_gimple_rhs_class (enum tree_code code)
 /* Return the LHS of assignment statement GS.  */
 
 static inline tree
-gimple_assign_lhs (const_gimple gs)
+gimple_assign_lhs (const gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  return gimple_op (gs, 0);
+  return gs->op[0];
+}
+
+static inline tree
+gimple_assign_lhs (const gimple *gs)
+{
+  const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
+  return gimple_assign_lhs (ass);
 }
 
 
 /* Return a pointer to the LHS of assignment statement GS.  */
 
 static inline tree *
-gimple_assign_lhs_ptr (const_gimple gs)
+gimple_assign_lhs_ptr (gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  return gimple_op_ptr (gs, 0);
+  return &gs->op[0];
+}
+
+static inline tree *
+gimple_assign_lhs_ptr (gimple *gs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  return gimple_assign_lhs_ptr (ass);
 }
 
 
 /* Set LHS to be the LHS operand of assignment statement GS.  */
 
 static inline void
-gimple_assign_set_lhs (gimple gs, tree lhs)
+gimple_assign_set_lhs (gassign *gs, tree lhs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  gimple_set_op (gs, 0, lhs);
+  gs->op[0] = lhs;
 
   if (lhs && TREE_CODE (lhs) == SSA_NAME)
     SSA_NAME_DEF_STMT (lhs) = gs;
 }
 
+static inline void
+gimple_assign_set_lhs (gimple *gs, tree lhs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  gimple_assign_set_lhs (ass, lhs);
+}
+
 
 /* Return the first operand on the RHS of assignment statement GS.  */
 
 static inline tree
-gimple_assign_rhs1 (const_gimple gs)
+gimple_assign_rhs1 (const gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  return gimple_op (gs, 1);
+  return gs->op[1];
+}
+
+static inline tree
+gimple_assign_rhs1 (const gimple *gs)
+{
+  const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
+  return gimple_assign_rhs1 (ass);
 }
 
 
@@ -2366,20 +2623,31 @@ gimple_assign_rhs1 (const_gimple gs)
    statement GS.  */
 
 static inline tree *
-gimple_assign_rhs1_ptr (const_gimple gs)
+gimple_assign_rhs1_ptr (gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  return gimple_op_ptr (gs, 1);
+  return &gs->op[1];
+}
+
+static inline tree *
+gimple_assign_rhs1_ptr (gimple *gs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  return gimple_assign_rhs1_ptr (ass);
 }
 
 /* Set RHS to be the first operand on the RHS of assignment statement GS.  */
 
 static inline void
-gimple_assign_set_rhs1 (gimple gs, tree rhs)
+gimple_assign_set_rhs1 (gassign *gs, tree rhs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
+  gs->op[1] = rhs;
+}
 
-  gimple_set_op (gs, 1, rhs);
+static inline void
+gimple_assign_set_rhs1 (gimple *gs, tree rhs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  gimple_assign_set_rhs1 (ass, rhs);
 }
 
 
@@ -2387,73 +2655,104 @@ gimple_assign_set_rhs1 (gimple gs, tree rhs)
    If GS does not have two operands, NULL is returned instead.  */
 
 static inline tree
-gimple_assign_rhs2 (const_gimple gs)
+gimple_assign_rhs2 (const gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
   if (gimple_num_ops (gs) >= 3)
-    return gimple_op (gs, 2);
+    return gs->op[2];
   else
     return NULL_TREE;
 }
 
+static inline tree
+gimple_assign_rhs2 (const gimple *gs)
+{
+  const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
+  return gimple_assign_rhs2 (ass);
+}
+
 
 /* Return a pointer to the second operand on the RHS of assignment
    statement GS.  */
 
 static inline tree *
-gimple_assign_rhs2_ptr (const_gimple gs)
+gimple_assign_rhs2_ptr (gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  return gimple_op_ptr (gs, 2);
+  gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
+  return &gs->op[2];
+}
+
+static inline tree *
+gimple_assign_rhs2_ptr (gimple *gs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  return gimple_assign_rhs2_ptr (ass);
 }
 
 
 /* Set RHS to be the second operand on the RHS of assignment statement GS.  */
 
 static inline void
-gimple_assign_set_rhs2 (gimple gs, tree rhs)
+gimple_assign_set_rhs2 (gassign *gs, tree rhs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
+  gcc_gimple_checking_assert (gimple_num_ops (gs) >= 3);
+  gs->op[2] = rhs;
+}
 
-  gimple_set_op (gs, 2, rhs);
+static inline void
+gimple_assign_set_rhs2 (gimple *gs, tree rhs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  return gimple_assign_set_rhs2 (ass, rhs);
 }
 
 /* Return the third operand on the RHS of assignment statement GS.
    If GS does not have two operands, NULL is returned instead.  */
 
 static inline tree
-gimple_assign_rhs3 (const_gimple gs)
+gimple_assign_rhs3 (const gassign *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
   if (gimple_num_ops (gs) >= 4)
-    return gimple_op (gs, 3);
+    return gs->op[3];
   else
     return NULL_TREE;
 }
 
+static inline tree
+gimple_assign_rhs3 (const gimple *gs)
+{
+  const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
+  return gimple_assign_rhs3 (ass);
+}
+
 /* Return a pointer to the third operand on the RHS of assignment
    statement GS.  */
 
 static inline tree *
-gimple_assign_rhs3_ptr (const_gimple gs)
+gimple_assign_rhs3_ptr (gimple *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-  return gimple_op_ptr (gs, 3);
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
+  return &ass->op[3];
 }
 
 
 /* Set RHS to be the third operand on the RHS of assignment statement GS.  */
 
 static inline void
-gimple_assign_set_rhs3 (gimple gs, tree rhs)
+gimple_assign_set_rhs3 (gassign *gs, tree rhs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
+  gcc_gimple_checking_assert (gimple_num_ops (gs) >= 4);
+  gs->op[3] = rhs;
+}
 
-  gimple_set_op (gs, 3, rhs);
+static inline void
+gimple_assign_set_rhs3 (gimple *gs, tree rhs)
+{
+  gassign *ass = GIMPLE_CHECK2<gassign *> (gs);
+  gimple_assign_set_rhs3 (ass, rhs);
 }
 
+
 /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
    which expect to see only two operands.  */
 
@@ -2485,7 +2784,7 @@ gimple_assign_nontemporal_move_p (const gassign *gs)
 /* Sets nontemporal move flag of GS to NONTEMPORAL.  */
 
 static inline void
-gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
+gimple_assign_set_nontemporal_move (gimple *gs, bool nontemporal)
 {
   GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
   gs->nontemporal_move = nontemporal;
@@ -2497,27 +2796,31 @@ gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
    tree code of the object.  */
 
 static inline enum tree_code
-gimple_assign_rhs_code (const_gimple gs)
+gimple_assign_rhs_code (const gassign *gs)
 {
-  enum tree_code code;
-  GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
-  code = (enum tree_code) gs->subcode;
+  enum tree_code code = (enum tree_code) gs->subcode;
   /* While we initially set subcode to the TREE_CODE of the rhs for
      GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
      in sync when we rewrite stmts into SSA form or do SSA propagations.  */
   if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
-    code = TREE_CODE (gimple_assign_rhs1 (gs));
+    code = TREE_CODE (gs->op[1]);
 
   return code;
 }
 
+static inline enum tree_code
+gimple_assign_rhs_code (const gimple *gs)
+{
+  const gassign *ass = GIMPLE_CHECK2<const gassign *> (gs);
+  return gimple_assign_rhs_code (ass);
+}
+
 
 /* Set CODE to be the code for the expression computed on the RHS of
    assignment S.  */
 
 static inline void
-gimple_assign_set_rhs_code (gimple s, enum tree_code code)
+gimple_assign_set_rhs_code (gimple *s, enum tree_code code)
 {
   GIMPLE_CHECK (s, GIMPLE_ASSIGN);
   s->subcode = code;
@@ -2529,7 +2832,7 @@ gimple_assign_set_rhs_code (gimple s, enum tree_code code)
    This will never return GIMPLE_INVALID_RHS.  */
 
 static inline enum gimple_rhs_class
-gimple_assign_rhs_class (const_gimple gs)
+gimple_assign_rhs_class (const gimple *gs)
 {
   return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
 }
@@ -2541,7 +2844,7 @@ gimple_assign_rhs_class (const_gimple gs)
    and do not have the semantics of a copy, such as COND_EXPR.  */
 
 static inline bool
-gimple_assign_single_p (const_gimple gs)
+gimple_assign_single_p (const gimple *gs)
 {
   return (is_gimple_assign (gs)
           && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
@@ -2550,7 +2853,7 @@ gimple_assign_single_p (const_gimple gs)
 /* Return true if GS performs a store to its lhs.  */
 
 static inline bool
-gimple_store_p (const_gimple gs)
+gimple_store_p (const gimple *gs)
 {
   tree lhs = gimple_get_lhs (gs);
   return lhs && !is_gimple_reg (lhs);
@@ -2559,7 +2862,7 @@ gimple_store_p (const_gimple gs)
 /* Return true if GS is an assignment that loads from its rhs1.  */
 
 static inline bool
-gimple_assign_load_p (const_gimple gs)
+gimple_assign_load_p (const gimple *gs)
 {
   tree rhs;
   if (!gimple_assign_single_p (gs))
@@ -2576,7 +2879,7 @@ gimple_assign_load_p (const_gimple gs)
 /* Return true if S is a type-cast assignment.  */
 
 static inline bool
-gimple_assign_cast_p (const_gimple s)
+gimple_assign_cast_p (const gimple *s)
 {
   if (is_gimple_assign (s))
     {
@@ -2592,7 +2895,7 @@ gimple_assign_cast_p (const_gimple s)
 /* Return true if S is a clobber statement.  */
 
 static inline bool
-gimple_clobber_p (const_gimple s)
+gimple_clobber_p (const gimple *s)
 {
   return gimple_assign_single_p (s)
          && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
@@ -2601,7 +2904,7 @@ gimple_clobber_p (const_gimple s)
 /* Return true if GS is a GIMPLE_CALL.  */
 
 static inline bool
-is_gimple_call (const_gimple gs)
+is_gimple_call (const gimple *gs)
 {
   return gimple_code (gs) == GIMPLE_CALL;
 }
@@ -2609,113 +2912,180 @@ is_gimple_call (const_gimple gs)
 /* Return the LHS of call statement GS.  */
 
 static inline tree
-gimple_call_lhs (const_gimple gs)
+gimple_call_lhs (const gcall *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op (gs, 0);
+  return gs->op[0];
+}
+
+static inline tree
+gimple_call_lhs (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_lhs (gc);
 }
 
 
 /* Return a pointer to the LHS of call statement GS.  */
 
 static inline tree *
-gimple_call_lhs_ptr (const_gimple gs)
+gimple_call_lhs_ptr (gcall *gs)
+{
+  return &gs->op[0];
+}
+
+static inline tree *
+gimple_call_lhs_ptr (gimple *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op_ptr (gs, 0);
+  gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
+  return gimple_call_lhs_ptr (gc);
 }
 
 
 /* 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 (gcall *gs, tree lhs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  gimple_set_op (gs, 0, lhs);
+  gs->op[0] = lhs;
   if (lhs && TREE_CODE (lhs) == SSA_NAME)
     SSA_NAME_DEF_STMT (lhs) = gs;
 }
 
+static inline void
+gimple_call_set_lhs (gimple *gs, tree lhs)
+{
+  gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
+  gimple_call_set_lhs (gc, lhs);
+}
+
 
 /* Return true if call GS calls an internal-only function, as enumerated
    by internal_fn.  */
 
 static inline bool
-gimple_call_internal_p (const_gimple gs)
+gimple_call_internal_p (const gcall *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
   return (gs->subcode & GF_CALL_INTERNAL) != 0;
 }
 
+static inline bool
+gimple_call_internal_p (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_internal_p (gc);
+}
 
-/* Return true if call GS is marked as instrumented by
-   Pointer Bounds Checker.  */
+/* Return true if call GS is marked as nocf_check.  */
 
 static inline bool
-gimple_call_with_bounds_p (const_gimple gs)
+gimple_call_nocf_check_p (const gcall *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return (gs->subcode & GF_CALL_WITH_BOUNDS) != 0;
+  return (gs->subcode & GF_CALL_NOCF_CHECK) != 0;
 }
 
-
-/* If INSTRUMENTED_P is true, marm statement GS as instrumented by
-   Pointer Bounds Checker.  */
+/* Mark statement GS as nocf_check call.  */
 
 static inline void
-gimple_call_set_with_bounds (gimple gs, bool with_bounds)
+gimple_call_set_nocf_check (gcall *gs, bool nocf_check)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  if (with_bounds)
-    gs->subcode |= GF_CALL_WITH_BOUNDS;
+  if (nocf_check)
+    gs->subcode |= GF_CALL_NOCF_CHECK;
   else
-    gs->subcode &= ~GF_CALL_WITH_BOUNDS;
+    gs->subcode &= ~GF_CALL_NOCF_CHECK;
 }
 
-
 /* Return the target of internal call GS.  */
 
 static inline enum internal_fn
-gimple_call_internal_fn (const_gimple gs)
+gimple_call_internal_fn (const gcall *gs)
 {
   gcc_gimple_checking_assert (gimple_call_internal_p (gs));
-  return static_cast <const gcall *> (gs)->u.internal_fn;
+  return gs->u.internal_fn;
+}
+
+static inline enum internal_fn
+gimple_call_internal_fn (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_internal_fn (gc);
+}
+
+/* Return true, if this internal gimple call is unique.  */
+
+static inline bool
+gimple_call_internal_unique_p (const gcall *gs)
+{
+  return gimple_call_internal_fn (gs) == IFN_UNIQUE;
+}
+
+static inline bool
+gimple_call_internal_unique_p (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_internal_unique_p (gc);
+}
+
+/* Return true if GS is an internal function FN.  */
+
+static inline bool
+gimple_call_internal_p (const gimple *gs, internal_fn fn)
+{
+  return (is_gimple_call (gs)
+         && gimple_call_internal_p (gs)
+         && gimple_call_internal_fn (gs) == fn);
 }
 
 /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
    that could alter control flow.  */
 
 static inline void
-gimple_call_set_ctrl_altering (gimple s, bool ctrl_altering_p)
+gimple_call_set_ctrl_altering (gcall *s, bool ctrl_altering_p)
 {
-  GIMPLE_CHECK (s, GIMPLE_CALL);
   if (ctrl_altering_p)
     s->subcode |= GF_CALL_CTRL_ALTERING;
   else
     s->subcode &= ~GF_CALL_CTRL_ALTERING;
 }
 
+static inline void
+gimple_call_set_ctrl_altering (gimple *s, bool ctrl_altering_p)
+{
+  gcall *gc = GIMPLE_CHECK2<gcall *> (s);
+  gimple_call_set_ctrl_altering (gc, ctrl_altering_p);
+}
+
 /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
    flag is set. Such call could not be a stmt in the middle of a bb.  */
 
 static inline bool
-gimple_call_ctrl_altering_p (const_gimple gs)
+gimple_call_ctrl_altering_p (const gcall *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
   return (gs->subcode & GF_CALL_CTRL_ALTERING) != 0;
 }
 
+static inline bool
+gimple_call_ctrl_altering_p (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_ctrl_altering_p (gc);
+}
+
 
 /* Return the function type of the function called by GS.  */
 
 static inline tree
-gimple_call_fntype (const_gimple gs)
+gimple_call_fntype (const gcall *gs)
 {
-  const gcall *call_stmt = as_a <const gcall *> (gs);
   if (gimple_call_internal_p (gs))
     return NULL_TREE;
-  return call_stmt->u.fntype;
+  return gs->u.fntype;
+}
+
+static inline tree
+gimple_call_fntype (const gimple *gs)
+{
+  const gcall *call_stmt = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_fntype (call_stmt);
 }
 
 /* Set the type of the function called by CALL_STMT to FNTYPE.  */
@@ -2732,20 +3102,32 @@ gimple_call_set_fntype (gcall *call_stmt, tree fntype)
    statement GS.  */
 
 static inline tree
-gimple_call_fn (const_gimple gs)
+gimple_call_fn (const gcall *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op (gs, 1);
+  return gs->op[1];
 }
 
-/* Return a pointer to the tree node representing the function called by call
-   statement GS.  */
-
+static inline tree
+gimple_call_fn (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_fn (gc);
+}
+
+/* Return a pointer to the tree node representing the function called by call
+   statement GS.  */
+
 static inline tree *
-gimple_call_fn_ptr (const_gimple gs)
+gimple_call_fn_ptr (gcall *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op_ptr (gs, 1);
+  return &gs->op[1];
+}
+
+static inline tree *
+gimple_call_fn_ptr (gimple *gs)
+{
+  gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
+  return gimple_call_fn_ptr (gc);
 }
 
 
@@ -2755,18 +3137,25 @@ static inline void
 gimple_call_set_fn (gcall *gs, tree fn)
 {
   gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
-  gimple_set_op (gs, 1, fn);
+  gs->op[1] = fn;
 }
 
 
 /* Set FNDECL to be the function called by call statement GS.  */
 
 static inline void
-gimple_call_set_fndecl (gimple gs, tree decl)
+gimple_call_set_fndecl (gcall *gs, tree decl)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
   gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
-  gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
+  gs->op[1] = build1_loc (gimple_location (gs), ADDR_EXPR,
+                         build_pointer_type (TREE_TYPE (decl)), decl);
+}
+
+static inline void
+gimple_call_set_fndecl (gimple *gs, tree decl)
+{
+  gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
+  gimple_call_set_fndecl (gc, decl);
 }
 
 
@@ -2785,11 +3174,18 @@ gimple_call_set_internal_fn (gcall *call_stmt, enum internal_fn fn)
    get_callee_fndecl in tree land.  */
 
 static inline tree
-gimple_call_fndecl (const_gimple gs)
+gimple_call_fndecl (const gcall *gs)
 {
   return gimple_call_addr_fndecl (gimple_call_fn (gs));
 }
 
+static inline tree
+gimple_call_fndecl (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_fndecl (gc);
+}
+
 
 /* Return the type returned by call statement GS.  */
 
@@ -2810,19 +3206,25 @@ gimple_call_return_type (const gcall *gs)
 /* Return the static chain for call statement GS.  */
 
 static inline tree
-gimple_call_chain (const_gimple gs)
+gimple_call_chain (const gcall *gs)
+{
+  return gs->op[2];
+}
+
+static inline tree
+gimple_call_chain (const gimple *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op (gs, 2);
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_chain (gc);
 }
 
 
 /* Return a pointer to the static chain for call statement CALL_STMT.  */
 
 static inline tree *
-gimple_call_chain_ptr (const gcall *call_stmt)
+gimple_call_chain_ptr (gcall *call_stmt)
 {
-  return gimple_op_ptr (call_stmt, 2);
+  return &call_stmt->op[2];
 }
 
 /* Set CHAIN to be the static chain for call statement CALL_STMT.  */
@@ -2830,29 +3232,40 @@ gimple_call_chain_ptr (const gcall *call_stmt)
 static inline void
 gimple_call_set_chain (gcall *call_stmt, tree chain)
 {
-  gimple_set_op (call_stmt, 2, chain);
+  call_stmt->op[2] = chain;
 }
 
 
 /* Return the number of arguments used by call statement GS.  */
 
 static inline unsigned
-gimple_call_num_args (const_gimple gs)
+gimple_call_num_args (const gcall *gs)
 {
-  unsigned num_ops;
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  num_ops = gimple_num_ops (gs);
-  return num_ops - 3;
+  return gimple_num_ops (gs) - 3;
+}
+
+static inline unsigned
+gimple_call_num_args (const gimple *gs)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_num_args (gc);
 }
 
 
 /* Return the argument at position INDEX for call statement GS.  */
 
 static inline tree
-gimple_call_arg (const_gimple gs, unsigned index)
+gimple_call_arg (const gcall *gs, unsigned index)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op (gs, index + 3);
+  gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
+  return gs->op[index + 3];
+}
+
+static inline tree
+gimple_call_arg (const gimple *gs, unsigned index)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+  return gimple_call_arg (gc, index);
 }
 
 
@@ -2860,20 +3273,34 @@ gimple_call_arg (const_gimple gs, unsigned index)
    statement GS.  */
 
 static inline tree *
-gimple_call_arg_ptr (const_gimple gs, unsigned index)
+gimple_call_arg_ptr (gcall *gs, unsigned index)
+{
+  gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
+  return &gs->op[index + 3];
+}
+
+static inline tree *
+gimple_call_arg_ptr (gimple *gs, unsigned index)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  return gimple_op_ptr (gs, index + 3);
+  gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
+  return gimple_call_arg_ptr (gc, index);
 }
 
 
 /* Set ARG to be the argument at position INDEX for call statement GS.  */
 
 static inline void
-gimple_call_set_arg (gimple gs, unsigned index, tree arg)
+gimple_call_set_arg (gcall *gs, unsigned index, tree arg)
 {
-  GIMPLE_CHECK (gs, GIMPLE_CALL);
-  gimple_set_op (gs, index + 3, arg);
+  gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 3);
+  gs->op[index + 3] = arg;
+}
+
+static inline void
+gimple_call_set_arg (gimple *gs, unsigned index, tree arg)
+{
+  gcall *gc = GIMPLE_CHECK2<gcall *> (gs);
+  gimple_call_set_arg (gc, index, arg);
 }
 
 
@@ -2894,11 +3321,30 @@ gimple_call_set_tail (gcall *s, bool tail_p)
 /* Return true if GIMPLE_CALL S is marked as a tail call.  */
 
 static inline bool
-gimple_call_tail_p (gcall *s)
+gimple_call_tail_p (const gcall *s)
 {
   return (s->subcode & GF_CALL_TAILCALL) != 0;
 }
 
+/* Mark (or clear) call statement S as requiring tail call optimization.  */
+
+static inline void
+gimple_call_set_must_tail (gcall *s, bool must_tail_p)
+{
+  if (must_tail_p)
+    s->subcode |= GF_CALL_MUST_TAIL_CALL;
+  else
+    s->subcode &= ~GF_CALL_MUST_TAIL_CALL;
+}
+
+/* Return true if call statement has been marked as requiring
+   tail call optimization.  */
+
+static inline bool
+gimple_call_must_tail_p (const gcall *s)
+{
+  return (s->subcode & GF_CALL_MUST_TAIL_CALL) != 0;
+}
 
 /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
    slot optimization.  This transformation uses the target of the call
@@ -2917,7 +3363,7 @@ gimple_call_set_return_slot_opt (gcall *s, bool return_slot_opt_p)
 /* Return true if S is marked for return slot optimization.  */
 
 static inline bool
-gimple_call_return_slot_opt_p (gcall *s)
+gimple_call_return_slot_opt_p (const gcall *s)
 {
   return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
 }
@@ -2962,7 +3408,7 @@ gimple_call_set_va_arg_pack (gcall *s, bool pass_arg_pack_p)
    argument pack in its argument list.  */
 
 static inline bool
-gimple_call_va_arg_pack_p (gcall *s)
+gimple_call_va_arg_pack_p (const gcall *s)
 {
   return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
 }
@@ -2971,12 +3417,18 @@ gimple_call_va_arg_pack_p (gcall *s)
 /* Return true if S is a noreturn call.  */
 
 static inline bool
-gimple_call_noreturn_p (gimple s)
+gimple_call_noreturn_p (const gcall *s)
 {
-  GIMPLE_CHECK (s, GIMPLE_CALL);
   return (gimple_call_flags (s) & ECF_NORETURN) != 0;
 }
 
+static inline bool
+gimple_call_noreturn_p (const gimple *s)
+{
+  const gcall *gc = GIMPLE_CHECK2<const gcall *> (s);
+  return gimple_call_noreturn_p (gc);
+}
+
 
 /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
    even if the called function can throw in other cases.  */
@@ -3020,6 +3472,26 @@ gimple_call_alloca_for_var_p (gcall *s)
   return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
 }
 
+/* If BY_DESCRIPTOR_P is true, GIMPLE_CALL S is an indirect call for which
+   pointers to nested function are descriptors instead of trampolines.  */
+
+static inline void
+gimple_call_set_by_descriptor (gcall  *s, bool by_descriptor_p)
+{
+  if (by_descriptor_p)
+    s->subcode |= GF_CALL_BY_DESCRIPTOR;
+  else
+    s->subcode &= ~GF_CALL_BY_DESCRIPTOR;
+}
+
+/* Return true if S is a by-descriptor call.  */
+
+static inline bool
+gimple_call_by_descriptor_p (gcall *s)
+{
+  return (s->subcode & GF_CALL_BY_DESCRIPTOR) != 0;
+}
+
 /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL.  */
 
 static inline void
@@ -3038,6 +3510,13 @@ gimple_call_use_set (gcall *call_stmt)
   return &call_stmt->call_used;
 }
 
+/* As above, but const.  */
+
+static inline const pt_solution *
+gimple_call_use_set (const gcall *call_stmt)
+{
+  return &call_stmt->call_used;
+}
 
 /* Return a pointer to the points-to solution for the set of call-used
    variables of the call CALL_STMT.  */
@@ -3048,28 +3527,44 @@ gimple_call_clobber_set (gcall *call_stmt)
   return &call_stmt->call_clobbered;
 }
 
+/* As above, but const.  */
+
+static inline const pt_solution *
+gimple_call_clobber_set (const gcall *call_stmt)
+{
+  return &call_stmt->call_clobbered;
+}
+
 
 /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
    non-NULL lhs.  */
 
 static inline bool
-gimple_has_lhs (gimple stmt)
+gimple_has_lhs (const gimple *stmt)
 {
-  return (is_gimple_assign (stmt)
-         || (is_gimple_call (stmt)
-             && gimple_call_lhs (stmt) != NULL_TREE));
+  if (is_gimple_assign (stmt))
+    return true;
+  if (const gcall *call = dyn_cast <const gcall *> (stmt))
+    return gimple_call_lhs (call) != NULL_TREE;
+  return false;
 }
 
 
 /* Return the code of the predicate computed by conditional statement GS.  */
 
 static inline enum tree_code
-gimple_cond_code (const_gimple gs)
+gimple_cond_code (const gcond *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_COND);
   return (enum tree_code) gs->subcode;
 }
 
+static inline enum tree_code
+gimple_cond_code (const gimple *gs)
+{
+  const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
+  return gimple_cond_code (gc);
+}
+
 
 /* Set CODE to be the predicate code for the conditional statement GS.  */
 
@@ -3083,19 +3578,25 @@ gimple_cond_set_code (gcond *gs, enum tree_code code)
 /* Return the LHS of the predicate computed by conditional statement GS.  */
 
 static inline tree
-gimple_cond_lhs (const_gimple gs)
+gimple_cond_lhs (const gcond *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_COND);
-  return gimple_op (gs, 0);
+  return gs->op[0];
+}
+
+static inline tree
+gimple_cond_lhs (const gimple *gs)
+{
+  const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
+  return gimple_cond_lhs (gc);
 }
 
 /* Return the pointer to the LHS of the predicate computed by conditional
    statement GS.  */
 
 static inline tree *
-gimple_cond_lhs_ptr (const gcond *gs)
+gimple_cond_lhs_ptr (gcond *gs)
 {
-  return gimple_op_ptr (gs, 0);
+  return &gs->op[0];
 }
 
 /* Set LHS to be the LHS operand of the predicate computed by
@@ -3104,26 +3605,32 @@ gimple_cond_lhs_ptr (const gcond *gs)
 static inline void
 gimple_cond_set_lhs (gcond *gs, tree lhs)
 {
-  gimple_set_op (gs, 0, lhs);
+  gs->op[0] = lhs;
 }
 
 
 /* Return the RHS operand of the predicate computed by conditional GS.  */
 
 static inline tree
-gimple_cond_rhs (const_gimple gs)
+gimple_cond_rhs (const gcond *gs)
 {
-  GIMPLE_CHECK (gs, GIMPLE_COND);
-  return gimple_op (gs, 1);
+  return gs->op[1];
+}
+
+static inline tree
+gimple_cond_rhs (const gimple *gs)
+{
+  const gcond *gc = GIMPLE_CHECK2<const gcond *> (gs);
+  return gimple_cond_rhs (gc);
 }
 
 /* Return the pointer to the RHS operand of the predicate computed by
    conditional GS.  */
 
 static inline tree *
-gimple_cond_rhs_ptr (const gcond *gs)
+gimple_cond_rhs_ptr (gcond *gs)
 {
-  return gimple_op_ptr (gs, 1);
+  return &gs->op[1];
 }
 
 
@@ -3133,7 +3640,7 @@ gimple_cond_rhs_ptr (const gcond *gs)
 static inline void
 gimple_cond_set_rhs (gcond *gs, tree rhs)
 {
-  gimple_set_op (gs, 1, rhs);
+  gs->op[1] = rhs;
 }
 
 
@@ -3143,7 +3650,7 @@ gimple_cond_set_rhs (gcond *gs, tree rhs)
 static inline tree
 gimple_cond_true_label (const gcond *gs)
 {
-  return gimple_op (gs, 2);
+  return gs->op[2];
 }
 
 
@@ -3153,7 +3660,7 @@ gimple_cond_true_label (const gcond *gs)
 static inline void
 gimple_cond_set_true_label (gcond *gs, tree label)
 {
-  gimple_set_op (gs, 2, label);
+  gs->op[2] = label;
 }
 
 
@@ -3163,7 +3670,7 @@ gimple_cond_set_true_label (gcond *gs, tree label)
 static inline void
 gimple_cond_set_false_label (gcond *gs, tree label)
 {
-  gimple_set_op (gs, 3, label);
+  gs->op[3] = label;
 }
 
 
@@ -3173,8 +3680,7 @@ gimple_cond_set_false_label (gcond *gs, tree label)
 static inline tree
 gimple_cond_false_label (const gcond *gs)
 {
-
-  return gimple_op (gs, 3);
+  return gs->op[3];
 }
 
 
@@ -3183,9 +3689,9 @@ gimple_cond_false_label (const gcond *gs)
 static inline void
 gimple_cond_make_false (gcond *gs)
 {
-  gimple_cond_set_lhs (gs, boolean_true_node);
+  gimple_cond_set_lhs (gs, boolean_false_node);
   gimple_cond_set_rhs (gs, boolean_false_node);
-  gs->subcode = EQ_EXPR;
+  gs->subcode = NE_EXPR;
 }
 
 
@@ -3195,8 +3701,8 @@ static inline void
 gimple_cond_make_true (gcond *gs)
 {
   gimple_cond_set_lhs (gs, boolean_true_node);
-  gimple_cond_set_rhs (gs, boolean_true_node);
-  gs->subcode = EQ_EXPR;
+  gimple_cond_set_rhs (gs, boolean_false_node);
+  gs->subcode = NE_EXPR;
 }
 
 /* Check if conditional statemente GS is of the form 'if (1 == 1)',
@@ -3265,7 +3771,7 @@ gimple_cond_set_condition (gcond *stmt, enum tree_code code, tree lhs,
 static inline tree
 gimple_label_label (const glabel *gs)
 {
-  return gimple_op (gs, 0);
+  return gs->op[0];
 }
 
 
@@ -3275,14 +3781,14 @@ gimple_label_label (const glabel *gs)
 static inline void
 gimple_label_set_label (glabel *gs, tree label)
 {
-  gimple_set_op (gs, 0, label);
+  gs->op[0] = label;
 }
 
 
 /* Return the destination of the unconditional jump GS.  */
 
 static inline tree
-gimple_goto_dest (const_gimple gs)
+gimple_goto_dest (const gimple *gs)
 {
   GIMPLE_CHECK (gs, GIMPLE_GOTO);
   return gimple_op (gs, 0);
@@ -3294,7 +3800,7 @@ gimple_goto_dest (const_gimple gs)
 static inline void
 gimple_goto_set_dest (ggoto *gs, tree dest)
 {
-  gimple_set_op (gs, 0, dest);
+  gs->op[0] = dest;
 }
 
 
@@ -3336,9 +3842,9 @@ gimple_bind_body_ptr (gbind *bind_stmt)
 /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS.  */
 
 static inline gimple_seq
-gimple_bind_body (gbind *gs)
+gimple_bind_body (const gbind *gs)
 {
-  return *gimple_bind_body_ptr (gs);
+  return *gimple_bind_body_ptr (const_cast <gbind *> (gs));
 }
 
 
@@ -3355,7 +3861,7 @@ gimple_bind_set_body (gbind *bind_stmt, gimple_seq seq)
 /* Append a statement to the end of a GIMPLE_BIND's body.  */
 
 static inline void
-gimple_bind_add_stmt (gbind *bind_stmt, gimple stmt)
+gimple_bind_add_stmt (gbind *bind_stmt, gimple *stmt)
 {
   gimple_seq_add_stmt (&bind_stmt->body, stmt);
 }
@@ -3432,19 +3938,9 @@ static inline tree
 gimple_asm_input_op (const gasm *asm_stmt, unsigned index)
 {
   gcc_gimple_checking_assert (index < asm_stmt->ni);
-  return gimple_op (asm_stmt, index + asm_stmt->no);
+  return asm_stmt->op[index + asm_stmt->no];
 }
 
-/* Return a pointer to input operand INDEX of GIMPLE_ASM ASM_STMT.  */
-
-static inline tree *
-gimple_asm_input_op_ptr (const gasm *asm_stmt, unsigned index)
-{
-  gcc_gimple_checking_assert (index < asm_stmt->ni);
-  return gimple_op_ptr (asm_stmt, index + asm_stmt->no);
-}
-
-
 /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT.  */
 
 static inline void
@@ -3452,7 +3948,7 @@ gimple_asm_set_input_op (gasm *asm_stmt, unsigned index, tree in_op)
 {
   gcc_gimple_checking_assert (index < asm_stmt->ni
                              && TREE_CODE (in_op) == TREE_LIST);
-  gimple_set_op (asm_stmt, index + asm_stmt->no, in_op);
+  asm_stmt->op[index + asm_stmt->no] = in_op;
 }
 
 
@@ -3462,19 +3958,9 @@ static inline tree
 gimple_asm_output_op (const gasm *asm_stmt, unsigned index)
 {
   gcc_gimple_checking_assert (index < asm_stmt->no);
-  return gimple_op (asm_stmt, index);
+  return asm_stmt->op[index];
 }
 
-/* Return a pointer to output operand INDEX of GIMPLE_ASM ASM_STMT.  */
-
-static inline tree *
-gimple_asm_output_op_ptr (const gasm *asm_stmt, unsigned index)
-{
-  gcc_gimple_checking_assert (index < asm_stmt->no);
-  return gimple_op_ptr (asm_stmt, index);
-}
-
-
 /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT.  */
 
 static inline void
@@ -3482,7 +3968,7 @@ gimple_asm_set_output_op (gasm *asm_stmt, unsigned index, tree out_op)
 {
   gcc_gimple_checking_assert (index < asm_stmt->no
                              && TREE_CODE (out_op) == TREE_LIST);
-  gimple_set_op (asm_stmt, index, out_op);
+  asm_stmt->op[index] = out_op;
 }
 
 
@@ -3492,7 +3978,7 @@ static inline tree
 gimple_asm_clobber_op (const gasm *asm_stmt, unsigned index)
 {
   gcc_gimple_checking_assert (index < asm_stmt->nc);
-  return gimple_op (asm_stmt, index + asm_stmt->ni + asm_stmt->no);
+  return asm_stmt->op[index + asm_stmt->ni + asm_stmt->no];
 }
 
 
@@ -3503,7 +3989,7 @@ gimple_asm_set_clobber_op (gasm *asm_stmt, unsigned index, tree clobber_op)
 {
   gcc_gimple_checking_assert (index < asm_stmt->nc
                              && TREE_CODE (clobber_op) == TREE_LIST);
-  gimple_set_op (asm_stmt, index + asm_stmt->ni + asm_stmt->no, clobber_op);
+  asm_stmt->op[index + asm_stmt->ni + asm_stmt->no] = clobber_op;
 }
 
 /* Return label operand INDEX of GIMPLE_ASM ASM_STMT.  */
@@ -3512,7 +3998,7 @@ static inline tree
 gimple_asm_label_op (const gasm *asm_stmt, unsigned index)
 {
   gcc_gimple_checking_assert (index < asm_stmt->nl);
-  return gimple_op (asm_stmt, index + asm_stmt->ni + asm_stmt->nc);
+  return asm_stmt->op[index + asm_stmt->ni + asm_stmt->nc];
 }
 
 /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT.  */
@@ -3522,7 +4008,7 @@ gimple_asm_set_label_op (gasm *asm_stmt, unsigned index, tree label_op)
 {
   gcc_gimple_checking_assert (index < asm_stmt->nl
                              && TREE_CODE (label_op) == TREE_LIST);
-  gimple_set_op (asm_stmt, index + asm_stmt->ni + asm_stmt->nc, label_op);
+  asm_stmt->op[index + asm_stmt->ni + asm_stmt->nc] = label_op;
 }
 
 /* Return the string representing the assembly instruction in
@@ -3535,7 +4021,7 @@ gimple_asm_string (const gasm *asm_stmt)
 }
 
 
-/* Return true ASM_STMT ASM_STMT is an asm statement marked volatile.  */
+/* Return true if ASM_STMT is marked volatile.  */
 
 static inline bool
 gimple_asm_volatile_p (const gasm *asm_stmt)
@@ -3544,7 +4030,7 @@ gimple_asm_volatile_p (const gasm *asm_stmt)
 }
 
 
-/* If VOLATLE_P is true, mark asm statement ASM_STMT as volatile.  */
+/* If VOLATILE_P is true, mark asm statement ASM_STMT as volatile.  */
 
 static inline void
 gimple_asm_set_volatile (gasm *asm_stmt, bool volatile_p)
@@ -3556,6 +4042,27 @@ gimple_asm_set_volatile (gasm *asm_stmt, bool volatile_p)
 }
 
 
+/* Return true if ASM_STMT is marked inline.  */
+
+static inline bool
+gimple_asm_inline_p (const gasm *asm_stmt)
+{
+  return (asm_stmt->subcode & GF_ASM_INLINE) != 0;
+}
+
+
+/* If INLINE_P is true, mark asm statement ASM_STMT as inline.  */
+
+static inline void
+gimple_asm_set_inline (gasm *asm_stmt, bool inline_p)
+{
+  if (inline_p)
+    asm_stmt->subcode |= GF_ASM_INLINE;
+  else
+    asm_stmt->subcode &= ~GF_ASM_INLINE;
+}
+
+
 /* If INPUT_P is true, mark asm ASM_STMT as an ASM_INPUT.  */
 
 static inline void
@@ -3609,9 +4116,9 @@ gimple_catch_handler_ptr (gcatch *catch_stmt)
    GIMPLE_CATCH statement CATCH_STMT.  */
 
 static inline gimple_seq
-gimple_catch_handler (gcatch *catch_stmt)
+gimple_catch_handler (const gcatch *catch_stmt)
 {
-  return *gimple_catch_handler_ptr (catch_stmt);
+  return *gimple_catch_handler_ptr (const_cast <gcatch *> (catch_stmt));
 }
 
 
@@ -3636,7 +4143,7 @@ gimple_catch_set_handler (gcatch *catch_stmt, gimple_seq handler)
 /* Return the types handled by GIMPLE_EH_FILTER statement GS.  */
 
 static inline tree
-gimple_eh_filter_types (const_gimple gs)
+gimple_eh_filter_types (const gimple *gs)
 {
   const geh_filter *eh_filter_stmt = as_a <const geh_filter *> (gs);
   return eh_filter_stmt->types;
@@ -3647,7 +4154,7 @@ gimple_eh_filter_types (const_gimple gs)
    GS.  */
 
 static inline tree *
-gimple_eh_filter_types_ptr (gimple gs)
+gimple_eh_filter_types_ptr (gimple *gs)
 {
   geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
   return &eh_filter_stmt->types;
@@ -3658,7 +4165,7 @@ gimple_eh_filter_types_ptr (gimple gs)
    GIMPLE_EH_FILTER statement fails.  */
 
 static inline gimple_seq *
-gimple_eh_filter_failure_ptr (gimple gs)
+gimple_eh_filter_failure_ptr (gimple *gs)
 {
   geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
   return &eh_filter_stmt->failure;
@@ -3669,9 +4176,9 @@ gimple_eh_filter_failure_ptr (gimple gs)
    statement fails.  */
 
 static inline gimple_seq
-gimple_eh_filter_failure (gimple gs)
+gimple_eh_filter_failure (const gimple *gs)
 {
-  return *gimple_eh_filter_failure_ptr (gs);
+  return *gimple_eh_filter_failure_ptr (const_cast <gimple *> (gs));
 }
 
 
@@ -3698,7 +4205,7 @@ gimple_eh_filter_set_failure (geh_filter *eh_filter_stmt,
 /* Get the function decl to be called by the MUST_NOT_THROW region.  */
 
 static inline tree
-gimple_eh_must_not_throw_fndecl (geh_mnt *eh_mnt_stmt)
+gimple_eh_must_not_throw_fndecl (const geh_mnt *eh_mnt_stmt)
 {
   return eh_mnt_stmt->fndecl;
 }
@@ -3721,9 +4228,9 @@ gimple_eh_else_n_body_ptr (geh_else *eh_else_stmt)
 }
 
 static inline gimple_seq
-gimple_eh_else_n_body (geh_else *eh_else_stmt)
+gimple_eh_else_n_body (const geh_else *eh_else_stmt)
 {
-  return *gimple_eh_else_n_body_ptr (eh_else_stmt);
+  return *gimple_eh_else_n_body_ptr (const_cast <geh_else *> (eh_else_stmt));
 }
 
 static inline gimple_seq *
@@ -3733,9 +4240,9 @@ gimple_eh_else_e_body_ptr (geh_else *eh_else_stmt)
 }
 
 static inline gimple_seq
-gimple_eh_else_e_body (geh_else *eh_else_stmt)
+gimple_eh_else_e_body (const geh_else *eh_else_stmt)
 {
-  return *gimple_eh_else_e_body_ptr (eh_else_stmt);
+  return *gimple_eh_else_e_body_ptr (const_cast <geh_else *> (eh_else_stmt));
 }
 
 static inline void
@@ -3756,7 +4263,7 @@ gimple_eh_else_set_e_body (geh_else *eh_else_stmt, gimple_seq seq)
    either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY.  */
 
 static inline enum gimple_try_flags
-gimple_try_kind (const_gimple gs)
+gimple_try_kind (const gimple *gs)
 {
   GIMPLE_CHECK (gs, GIMPLE_TRY);
   return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
@@ -3778,7 +4285,7 @@ gimple_try_set_kind (gtry *gs, enum gimple_try_flags kind)
 /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag.  */
 
 static inline bool
-gimple_try_catch_is_cleanup (const_gimple gs)
+gimple_try_catch_is_cleanup (const gimple *gs)
 {
   gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
   return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
@@ -3789,7 +4296,7 @@ gimple_try_catch_is_cleanup (const_gimple gs)
    body for GIMPLE_TRY GS.  */
 
 static inline gimple_seq *
-gimple_try_eval_ptr (gimple gs)
+gimple_try_eval_ptr (gimple *gs)
 {
   gtry *try_stmt = as_a <gtry *> (gs);
   return &try_stmt->eval;
@@ -3799,9 +4306,9 @@ gimple_try_eval_ptr (gimple gs)
 /* Return the sequence of statements used as the body for GIMPLE_TRY GS.  */
 
 static inline gimple_seq
-gimple_try_eval (gimple gs)
+gimple_try_eval (const gimple *gs)
 {
-  return *gimple_try_eval_ptr (gs);
+  return *gimple_try_eval_ptr (const_cast <gimple *> (gs));
 }
 
 
@@ -3809,7 +4316,7 @@ gimple_try_eval (gimple gs)
    GIMPLE_TRY GS.  */
 
 static inline gimple_seq *
-gimple_try_cleanup_ptr (gimple gs)
+gimple_try_cleanup_ptr (gimple *gs)
 {
   gtry *try_stmt = as_a <gtry *> (gs);
   return &try_stmt->cleanup;
@@ -3820,9 +4327,9 @@ gimple_try_cleanup_ptr (gimple gs)
    GIMPLE_TRY GS.  */
 
 static inline gimple_seq
-gimple_try_cleanup (gimple gs)
+gimple_try_cleanup (const gimple *gs)
 {
-  return *gimple_try_cleanup_ptr (gs);
+  return *gimple_try_cleanup_ptr (const_cast <gimple *> (gs));
 }
 
 
@@ -3862,7 +4369,7 @@ gimple_try_set_cleanup (gtry *try_stmt, gimple_seq cleanup)
 /* Return a pointer to the cleanup sequence for cleanup statement GS.  */
 
 static inline gimple_seq *
-gimple_wce_cleanup_ptr (gimple gs)
+gimple_wce_cleanup_ptr (gimple *gs)
 {
   gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
   return &wce_stmt->cleanup;
@@ -3872,7 +4379,7 @@ gimple_wce_cleanup_ptr (gimple gs)
 /* Return the cleanup sequence for cleanup statement GS.  */
 
 static inline gimple_seq
-gimple_wce_cleanup (gimple gs)
+gimple_wce_cleanup (gimple *gs)
 {
   return *gimple_wce_cleanup_ptr (gs);
 }
@@ -3881,7 +4388,7 @@ gimple_wce_cleanup (gimple gs)
 /* Set CLEANUP to be the cleanup sequence for GS.  */
 
 static inline void
-gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
+gimple_wce_set_cleanup (gimple *gs, gimple_seq cleanup)
 {
   gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
   wce_stmt->cleanup = cleanup;
@@ -3891,7 +4398,7 @@ gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
 /* Return the CLEANUP_EH_ONLY flag for a WCE tuple.  */
 
 static inline bool
-gimple_wce_cleanup_eh_only (const_gimple gs)
+gimple_wce_cleanup_eh_only (const gimple *gs)
 {
   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
   return gs->subcode != 0;
@@ -3901,7 +4408,7 @@ gimple_wce_cleanup_eh_only (const_gimple gs)
 /* Set the CLEANUP_EH_ONLY flag for a WCE tuple.  */
 
 static inline void
-gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
+gimple_wce_set_cleanup_eh_only (gimple *gs, bool eh_only_p)
 {
   GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
   gs->subcode = (unsigned int) eh_only_p;
@@ -3911,7 +4418,7 @@ gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
 /* Return the maximum number of arguments supported by GIMPLE_PHI GS.  */
 
 static inline unsigned
-gimple_phi_capacity (const_gimple gs)
+gimple_phi_capacity (const gimple *gs)
 {
   const gphi *phi_stmt = as_a <const gphi *> (gs);
   return phi_stmt->capacity;
@@ -3923,7 +4430,7 @@ gimple_phi_capacity (const_gimple gs)
    GS.  */
 
 static inline unsigned
-gimple_phi_num_args (const_gimple gs)
+gimple_phi_num_args (const gimple *gs)
 {
   const gphi *phi_stmt = as_a <const gphi *> (gs);
   return phi_stmt->nargs;
@@ -3933,19 +4440,31 @@ gimple_phi_num_args (const_gimple gs)
 /* Return the SSA name created by GIMPLE_PHI GS.  */
 
 static inline tree
-gimple_phi_result (const_gimple gs)
+gimple_phi_result (const gphi *gs)
+{
+  return gs->result;
+}
+
+static inline tree
+gimple_phi_result (const gimple *gs)
 {
   const gphi *phi_stmt = as_a <const gphi *> (gs);
-  return phi_stmt->result;
+  return gimple_phi_result (phi_stmt);
 }
 
 /* Return a pointer to the SSA name created by GIMPLE_PHI GS.  */
 
 static inline tree *
-gimple_phi_result_ptr (gimple gs)
+gimple_phi_result_ptr (gphi *gs)
+{
+  return &gs->result;
+}
+
+static inline tree *
+gimple_phi_result_ptr (gimple *gs)
 {
   gphi *phi_stmt = as_a <gphi *> (gs);
-  return &phi_stmt->result;
+  return gimple_phi_result_ptr (phi_stmt);
 }
 
 /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI.  */
@@ -3963,11 +4482,24 @@ gimple_phi_set_result (gphi *phi, tree result)
    GIMPLE_PHI GS.  */
 
 static inline struct phi_arg_d *
-gimple_phi_arg (gimple gs, unsigned index)
+gimple_phi_arg (gphi *gs, unsigned index)
+{
+  gcc_gimple_checking_assert (index < gs->nargs);
+  return &(gs->args[index]);
+}
+
+static inline const phi_arg_d *
+gimple_phi_arg (const gphi *gs, unsigned index)
+{
+  gcc_gimple_checking_assert (index < gs->nargs);
+  return &(gs->args[index]);
+}
+
+static inline struct phi_arg_d *
+gimple_phi_arg (gimple *gs, unsigned index)
 {
   gphi *phi_stmt = as_a <gphi *> (gs);
-  gcc_gimple_checking_assert (index <= phi_stmt->capacity);
-  return &(phi_stmt->args[index]);
+  return gimple_phi_arg (phi_stmt, index);
 }
 
 /* Set PHIARG to be the argument corresponding to incoming edge INDEX
@@ -3976,7 +4508,7 @@ gimple_phi_arg (gimple gs, unsigned index)
 static inline void
 gimple_phi_set_arg (gphi *phi, unsigned index, struct phi_arg_d * phiarg)
 {
-  gcc_gimple_checking_assert (index <= phi->nargs);
+  gcc_gimple_checking_assert (index < phi->nargs);
   phi->args[index] = *phiarg;
 }
 
@@ -4002,7 +4534,13 @@ phi_nodes_ptr (basic_block bb)
 /* Return the tree operand for argument I of PHI node GS.  */
 
 static inline tree
-gimple_phi_arg_def (gimple gs, size_t index)
+gimple_phi_arg_def (const gphi *gs, size_t index)
+{
+  return gimple_phi_arg (gs, index)->def;
+}
+
+static inline tree
+gimple_phi_arg_def (gimple *gs, size_t index)
 {
   return gimple_phi_arg (gs, index)->def;
 }
@@ -4019,22 +4557,22 @@ gimple_phi_arg_def_ptr (gphi *phi, size_t index)
 /* Return the edge associated with argument I of phi node PHI.  */
 
 static inline edge
-gimple_phi_arg_edge (gphi *phi, size_t i)
+gimple_phi_arg_edge (const gphi *phi, size_t i)
 {
   return EDGE_PRED (gimple_bb (phi), i);
 }
 
 /* Return the source location of gimple argument I of phi node PHI.  */
 
-static inline source_location
-gimple_phi_arg_location (gphi *phi, size_t i)
+static inline location_t
+gimple_phi_arg_location (const gphi *phi, size_t i)
 {
   return gimple_phi_arg (phi, i)->locus;
 }
 
 /* Return the source location of the argument on edge E of phi node PHI.  */
 
-static inline source_location
+static inline location_t
 gimple_phi_arg_location_from_edge (gphi *phi, edge e)
 {
   return gimple_phi_arg (phi, e->dest_idx)->locus;
@@ -4043,7 +4581,7 @@ gimple_phi_arg_location_from_edge (gphi *phi, edge e)
 /* Set the source location of gimple argument I of phi node PHI to LOC.  */
 
 static inline void
-gimple_phi_arg_set_location (gphi *phi, size_t i, source_location loc)
+gimple_phi_arg_set_location (gphi *phi, size_t i, location_t loc)
 {
   gimple_phi_arg (phi, i)->locus = loc;
 }
@@ -4051,7 +4589,7 @@ gimple_phi_arg_set_location (gphi *phi, size_t i, source_location loc)
 /* Return TRUE if argument I of phi node PHI has a location record.  */
 
 static inline bool
-gimple_phi_arg_has_location (gphi *phi, size_t i)
+gimple_phi_arg_has_location (const gphi *phi, size_t i)
 {
   return gimple_phi_arg_location (phi, i) != UNKNOWN_LOCATION;
 }
@@ -4118,16 +4656,16 @@ gimple_switch_set_num_labels (gswitch *g, unsigned nlabels)
 static inline tree
 gimple_switch_index (const gswitch *gs)
 {
-  return gimple_op (gs, 0);
+  return gs->op[0];
 }
 
 
 /* Return a pointer to the index variable for the switch statement GS.  */
 
 static inline tree *
-gimple_switch_index_ptr (const gswitch *gs)
+gimple_switch_index_ptr (gswitch *gs)
 {
-  return gimple_op_ptr (gs, 0);
+  return &gs->op[0];
 }
 
 
@@ -4136,9 +4674,8 @@ gimple_switch_index_ptr (const gswitch *gs)
 static inline void
 gimple_switch_set_index (gswitch *gs, tree index)
 {
-  GIMPLE_CHECK (gs, GIMPLE_SWITCH);
   gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
-  gimple_set_op (gs, 0, index);
+  gs->op[0] = index;
 }
 
 
@@ -4148,9 +4685,8 @@ gimple_switch_set_index (gswitch *gs, tree index)
 static inline tree
 gimple_switch_label (const gswitch *gs, unsigned index)
 {
-  GIMPLE_CHECK (gs, GIMPLE_SWITCH);
   gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
-  return gimple_op (gs, index + 1);
+  return gs->op[index + 1];
 }
 
 /* Set the label number INDEX to LABEL.  0 is always the default label.  */
@@ -4158,11 +4694,10 @@ gimple_switch_label (const gswitch *gs, unsigned index)
 static inline void
 gimple_switch_set_label (gswitch *gs, unsigned index, tree label)
 {
-  GIMPLE_CHECK (gs, GIMPLE_SWITCH);
   gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
                              && (label == NULL_TREE
                                  || TREE_CODE (label) == CASE_LABEL_EXPR));
-  gimple_set_op (gs, index + 1, label);
+  gs->op[index + 1] = label;
 }
 
 /* Return the default label for a switch statement.  */
@@ -4187,15 +4722,43 @@ gimple_switch_set_default_label (gswitch *gs, tree label)
 /* Return true if GS is a GIMPLE_DEBUG statement.  */
 
 static inline bool
-is_gimple_debug (const_gimple gs)
+is_gimple_debug (const gimple *gs)
 {
   return gimple_code (gs) == GIMPLE_DEBUG;
 }
 
+
+/* Return the first nondebug statement in GIMPLE sequence S.  */
+
+static inline gimple *
+gimple_seq_first_nondebug_stmt (gimple_seq s)
+{
+  gimple_seq_node n = gimple_seq_first (s);
+  while (n && is_gimple_debug (n))
+    n = n->next;
+  return n;
+}
+
+
+/* Return the last nondebug statement in GIMPLE sequence S.  */
+
+static inline gimple *
+gimple_seq_last_nondebug_stmt (gimple_seq s)
+{
+  gimple_seq_node n;
+  for (n = gimple_seq_last (s);
+       n && is_gimple_debug (n);
+       n = n->prev)
+    if (n == s)
+      return NULL;
+  return n;
+}
+
+
 /* Return true if S is a GIMPLE_DEBUG BIND statement.  */
 
 static inline bool
-gimple_debug_bind_p (const_gimple s)
+gimple_debug_bind_p (const gimple *s)
 {
   if (is_gimple_debug (s))
     return s->subcode == GIMPLE_DEBUG_BIND;
@@ -4206,7 +4769,7 @@ gimple_debug_bind_p (const_gimple s)
 /* Return the variable bound in a GIMPLE_DEBUG bind statement.  */
 
 static inline tree
-gimple_debug_bind_get_var (gimple dbg)
+gimple_debug_bind_get_var (const gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4217,7 +4780,7 @@ gimple_debug_bind_get_var (gimple dbg)
    statement.  */
 
 static inline tree
-gimple_debug_bind_get_value (gimple dbg)
+gimple_debug_bind_get_value (const gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4228,7 +4791,7 @@ gimple_debug_bind_get_value (gimple dbg)
    GIMPLE_DEBUG bind statement.  */
 
 static inline tree *
-gimple_debug_bind_get_value_ptr (gimple dbg)
+gimple_debug_bind_get_value_ptr (gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4238,7 +4801,7 @@ gimple_debug_bind_get_value_ptr (gimple dbg)
 /* Set the variable bound in a GIMPLE_DEBUG bind statement.  */
 
 static inline void
-gimple_debug_bind_set_var (gimple dbg, tree var)
+gimple_debug_bind_set_var (gimple *dbg, tree var)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4249,7 +4812,7 @@ gimple_debug_bind_set_var (gimple dbg, tree var)
    statement.  */
 
 static inline void
-gimple_debug_bind_set_value (gimple dbg, tree value)
+gimple_debug_bind_set_value (gimple *dbg, tree value)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4264,7 +4827,7 @@ gimple_debug_bind_set_value (gimple dbg, tree value)
    statement.  */
 
 static inline void
-gimple_debug_bind_reset_value (gimple dbg)
+gimple_debug_bind_reset_value (gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4275,7 +4838,7 @@ gimple_debug_bind_reset_value (gimple dbg)
    value.  */
 
 static inline bool
-gimple_debug_bind_has_value_p (gimple dbg)
+gimple_debug_bind_has_value_p (gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
@@ -4287,7 +4850,7 @@ gimple_debug_bind_has_value_p (gimple dbg)
 /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement.  */
 
 static inline bool
-gimple_debug_source_bind_p (const_gimple s)
+gimple_debug_source_bind_p (const gimple *s)
 {
   if (is_gimple_debug (s))
     return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
@@ -4298,7 +4861,7 @@ gimple_debug_source_bind_p (const_gimple s)
 /* Return the variable bound in a GIMPLE_DEBUG source bind statement.  */
 
 static inline tree
-gimple_debug_source_bind_get_var (gimple dbg)
+gimple_debug_source_bind_get_var (const gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
@@ -4309,7 +4872,7 @@ gimple_debug_source_bind_get_var (gimple dbg)
    statement.  */
 
 static inline tree
-gimple_debug_source_bind_get_value (gimple dbg)
+gimple_debug_source_bind_get_value (const gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
@@ -4320,7 +4883,7 @@ gimple_debug_source_bind_get_value (gimple dbg)
    GIMPLE_DEBUG source bind statement.  */
 
 static inline tree *
-gimple_debug_source_bind_get_value_ptr (gimple dbg)
+gimple_debug_source_bind_get_value_ptr (gimple *dbg)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
@@ -4330,7 +4893,7 @@ gimple_debug_source_bind_get_value_ptr (gimple dbg)
 /* Set the variable bound in a GIMPLE_DEBUG source bind statement.  */
 
 static inline void
-gimple_debug_source_bind_set_var (gimple dbg, tree var)
+gimple_debug_source_bind_set_var (gimple *dbg, tree var)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
@@ -4341,17 +4904,51 @@ gimple_debug_source_bind_set_var (gimple dbg, tree var)
    statement.  */
 
 static inline void
-gimple_debug_source_bind_set_value (gimple dbg, tree value)
+gimple_debug_source_bind_set_value (gimple *dbg, tree value)
 {
   GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
   gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
   gimple_set_op (dbg, 1, value);
 }
 
+/* Return true if S is a GIMPLE_DEBUG BEGIN_STMT statement.  */
+
+static inline bool
+gimple_debug_begin_stmt_p (const gimple *s)
+{
+  if (is_gimple_debug (s))
+    return s->subcode == GIMPLE_DEBUG_BEGIN_STMT;
+
+  return false;
+}
+
+/* Return true if S is a GIMPLE_DEBUG INLINE_ENTRY statement.  */
+
+static inline bool
+gimple_debug_inline_entry_p (const gimple *s)
+{
+  if (is_gimple_debug (s))
+    return s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
+
+  return false;
+}
+
+/* Return true if S is a GIMPLE_DEBUG non-binding marker statement.  */
+
+static inline bool
+gimple_debug_nonbind_marker_p (const gimple *s)
+{
+  if (is_gimple_debug (s))
+    return s->subcode == GIMPLE_DEBUG_BEGIN_STMT
+      || s->subcode == GIMPLE_DEBUG_INLINE_ENTRY;
+
+  return false;
+}
+
 /* Return the line number for EXPR, or return -1 if we have no line
    number information for it.  */
 static inline int
-get_lineno (const_gimple stmt)
+get_lineno (const gimple *stmt)
 {
   location_t loc;
 
@@ -4368,7 +4965,7 @@ get_lineno (const_gimple stmt)
 /* Return a pointer to the body for the OMP statement GS.  */
 
 static inline gimple_seq *
-gimple_omp_body_ptr (gimple gs)
+gimple_omp_body_ptr (gimple *gs)
 {
   return &static_cast <gimple_statement_omp *> (gs)->body;
 }
@@ -4376,15 +4973,15 @@ gimple_omp_body_ptr (gimple gs)
 /* Return the body for the OMP statement GS.  */
 
 static inline gimple_seq
-gimple_omp_body (gimple gs)
+gimple_omp_body (const gimple *gs)
 {
-  return *gimple_omp_body_ptr (gs);
+  return *gimple_omp_body_ptr (const_cast <gimple *> (gs));
 }
 
 /* Set BODY to be the body for the OMP statement GS.  */
 
 static inline void
-gimple_omp_set_body (gimple gs, gimple_seq body)
+gimple_omp_set_body (gimple *gs, gimple_seq body)
 {
   static_cast <gimple_statement_omp *> (gs)->body = body;
 }
@@ -4399,7 +4996,8 @@ gimple_omp_critical_name (const gomp_critical *crit_stmt)
 }
 
 
-/* Return a pointer to the name associated with OMP critical statement GS.  */
+/* Return a pointer to the name associated with OMP critical statement
+   CRIT_STMT.  */
 
 static inline tree *
 gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
@@ -4408,7 +5006,8 @@ gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
 }
 
 
-/* Set NAME to be the name associated with OMP critical statement GS.  */
+/* Set NAME to be the name associated with OMP critical statement
+   CRIT_STMT.  */
 
 static inline void
 gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
@@ -4417,10 +5016,131 @@ gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
 }
 
 
+/* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT.  */
+
+static inline tree
+gimple_omp_critical_clauses (const gomp_critical *crit_stmt)
+{
+  return crit_stmt->clauses;
+}
+
+
+/* Return a pointer to the clauses associated with OMP critical statement
+   CRIT_STMT.  */
+
+static inline tree *
+gimple_omp_critical_clauses_ptr (gomp_critical *crit_stmt)
+{
+  return &crit_stmt->clauses;
+}
+
+
+/* Set CLAUSES to be the clauses associated with OMP critical statement
+   CRIT_STMT.  */
+
+static inline void
+gimple_omp_critical_set_clauses (gomp_critical *crit_stmt, tree clauses)
+{
+  crit_stmt->clauses = clauses;
+}
+
+
+/* Return the clauses associated with OMP_ORDERED statement ORD_STMT.  */
+
+static inline tree
+gimple_omp_ordered_clauses (const gomp_ordered *ord_stmt)
+{
+  return ord_stmt->clauses;
+}
+
+
+/* Return a pointer to the clauses associated with OMP ordered statement
+   ORD_STMT.  */
+
+static inline tree *
+gimple_omp_ordered_clauses_ptr (gomp_ordered *ord_stmt)
+{
+  return &ord_stmt->clauses;
+}
+
+
+/* Set CLAUSES to be the clauses associated with OMP ordered statement
+   ORD_STMT.  */
+
+static inline void
+gimple_omp_ordered_set_clauses (gomp_ordered *ord_stmt, tree clauses)
+{
+  ord_stmt->clauses = clauses;
+}
+
+
+/* Return the clauses associated with OMP_SCAN statement SCAN_STMT.  */
+
+static inline tree
+gimple_omp_scan_clauses (const gomp_scan *scan_stmt)
+{
+  return scan_stmt->clauses;
+}
+
+
+/* Return a pointer to the clauses associated with OMP scan statement
+   ORD_STMT.  */
+
+static inline tree *
+gimple_omp_scan_clauses_ptr (gomp_scan *scan_stmt)
+{
+  return &scan_stmt->clauses;
+}
+
+
+/* Set CLAUSES to be the clauses associated with OMP scan statement
+   ORD_STMT.  */
+
+static inline void
+gimple_omp_scan_set_clauses (gomp_scan *scan_stmt, tree clauses)
+{
+  scan_stmt->clauses = clauses;
+}
+
+
+/* Return the clauses associated with OMP_TASKGROUP statement GS.  */
+
+static inline tree
+gimple_omp_taskgroup_clauses (const gimple *gs)
+{
+  GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
+  return
+    static_cast <const gimple_statement_omp_single_layout *> (gs)->clauses;
+}
+
+
+/* Return a pointer to the clauses associated with OMP taskgroup statement
+   GS.  */
+
+static inline tree *
+gimple_omp_taskgroup_clauses_ptr (gimple *gs)
+{
+  GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
+  return &static_cast <gimple_statement_omp_single_layout *> (gs)->clauses;
+}
+
+
+/* Set CLAUSES to be the clauses associated with OMP taskgroup statement
+   GS.  */
+
+static inline void
+gimple_omp_taskgroup_set_clauses (gimple *gs, tree clauses)
+{
+  GIMPLE_CHECK (gs, GIMPLE_OMP_TASKGROUP);
+  static_cast <gimple_statement_omp_single_layout *> (gs)->clauses
+    = clauses;
+}
+
+
 /* Return the kind of the OMP_FOR statemement G.  */
 
 static inline int
-gimple_omp_for_kind (const_gimple g)
+gimple_omp_for_kind (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
   return (gimple_omp_subcode (g) & GF_OMP_FOR_KIND_MASK);
@@ -4441,7 +5161,7 @@ gimple_omp_for_set_kind (gomp_for *g, int kind)
    GF_OMP_FOR_COMBINED flag set.  */
 
 static inline bool
-gimple_omp_for_combined_p (const_gimple g)
+gimple_omp_for_combined_p (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
   return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED) != 0;
@@ -4465,7 +5185,7 @@ gimple_omp_for_set_combined_p (gomp_for *g, bool combined_p)
    GF_OMP_FOR_COMBINED_INTO flag set.  */
 
 static inline bool
-gimple_omp_for_combined_into_p (const_gimple g)
+gimple_omp_for_combined_into_p (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
   return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED_INTO) != 0;
@@ -4488,7 +5208,7 @@ gimple_omp_for_set_combined_into_p (gomp_for *g, bool combined_p)
 /* Return the clauses associated with the OMP_FOR statement GS.  */
 
 static inline tree
-gimple_omp_for_clauses (const_gimple gs)
+gimple_omp_for_clauses (const gimple *gs)
 {
   const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   return omp_for_stmt->clauses;
@@ -4499,7 +5219,7 @@ gimple_omp_for_clauses (const_gimple gs)
    GS.  */
 
 static inline tree *
-gimple_omp_for_clauses_ptr (gimple gs)
+gimple_omp_for_clauses_ptr (gimple *gs)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   return &omp_for_stmt->clauses;
@@ -4510,7 +5230,7 @@ gimple_omp_for_clauses_ptr (gimple gs)
    GS.  */
 
 static inline void
-gimple_omp_for_set_clauses (gimple gs, tree clauses)
+gimple_omp_for_set_clauses (gimple *gs, tree clauses)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   omp_for_stmt->clauses = clauses;
@@ -4520,9 +5240,9 @@ gimple_omp_for_set_clauses (gimple gs, tree clauses)
 /* Get the collapse count of the OMP_FOR statement GS.  */
 
 static inline size_t
-gimple_omp_for_collapse (gimple gs)
+gimple_omp_for_collapse (const gimple *gs)
 {
-  gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
+  const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   return omp_for_stmt->collapse;
 }
 
@@ -4530,7 +5250,7 @@ gimple_omp_for_collapse (gimple gs)
 /* Return the condition code associated with the OMP_FOR statement GS.  */
 
 static inline enum tree_code
-gimple_omp_for_cond (const_gimple gs, size_t i)
+gimple_omp_for_cond (const gimple *gs, size_t i)
 {
   const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4541,7 +5261,7 @@ gimple_omp_for_cond (const_gimple gs, size_t i)
 /* Set COND to be the condition code for the OMP_FOR statement GS.  */
 
 static inline void
-gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
+gimple_omp_for_set_cond (gimple *gs, size_t i, enum tree_code cond)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
@@ -4553,7 +5273,7 @@ gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
 /* Return the index variable for the OMP_FOR statement GS.  */
 
 static inline tree
-gimple_omp_for_index (const_gimple gs, size_t i)
+gimple_omp_for_index (const gimple *gs, size_t i)
 {
   const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4564,7 +5284,7 @@ gimple_omp_for_index (const_gimple gs, size_t i)
 /* Return a pointer to the index variable for the OMP_FOR statement GS.  */
 
 static inline tree *
-gimple_omp_for_index_ptr (gimple gs, size_t i)
+gimple_omp_for_index_ptr (gimple *gs, size_t i)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4575,7 +5295,7 @@ gimple_omp_for_index_ptr (gimple gs, size_t i)
 /* Set INDEX to be the index variable for the OMP_FOR statement GS.  */
 
 static inline void
-gimple_omp_for_set_index (gimple gs, size_t i, tree index)
+gimple_omp_for_set_index (gimple *gs, size_t i, tree index)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4586,7 +5306,7 @@ gimple_omp_for_set_index (gimple gs, size_t i, tree index)
 /* Return the initial value for the OMP_FOR statement GS.  */
 
 static inline tree
-gimple_omp_for_initial (const_gimple gs, size_t i)
+gimple_omp_for_initial (const gimple *gs, size_t i)
 {
   const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4597,7 +5317,7 @@ gimple_omp_for_initial (const_gimple gs, size_t i)
 /* Return a pointer to the initial value for the OMP_FOR statement GS.  */
 
 static inline tree *
-gimple_omp_for_initial_ptr (gimple gs, size_t i)
+gimple_omp_for_initial_ptr (gimple *gs, size_t i)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4608,7 +5328,7 @@ gimple_omp_for_initial_ptr (gimple gs, size_t i)
 /* Set INITIAL to be the initial value for the OMP_FOR statement GS.  */
 
 static inline void
-gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
+gimple_omp_for_set_initial (gimple *gs, size_t i, tree initial)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4619,7 +5339,7 @@ gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
 /* Return the final value for the OMP_FOR statement GS.  */
 
 static inline tree
-gimple_omp_for_final (const_gimple gs, size_t i)
+gimple_omp_for_final (const gimple *gs, size_t i)
 {
   const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4630,7 +5350,7 @@ gimple_omp_for_final (const_gimple gs, size_t i)
 /* Return a pointer to the final value for the OMP_FOR statement GS.  */
 
 static inline tree *
-gimple_omp_for_final_ptr (gimple gs, size_t i)
+gimple_omp_for_final_ptr (gimple *gs, size_t i)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4641,7 +5361,7 @@ gimple_omp_for_final_ptr (gimple gs, size_t i)
 /* Set FINAL to be the final value for the OMP_FOR statement GS.  */
 
 static inline void
-gimple_omp_for_set_final (gimple gs, size_t i, tree final)
+gimple_omp_for_set_final (gimple *gs, size_t i, tree final)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4652,7 +5372,7 @@ gimple_omp_for_set_final (gimple gs, size_t i, tree final)
 /* Return the increment value for the OMP_FOR statement GS.  */
 
 static inline tree
-gimple_omp_for_incr (const_gimple gs, size_t i)
+gimple_omp_for_incr (const gimple *gs, size_t i)
 {
   const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4663,7 +5383,7 @@ gimple_omp_for_incr (const_gimple gs, size_t i)
 /* Return a pointer to the increment value for the OMP_FOR statement GS.  */
 
 static inline tree *
-gimple_omp_for_incr_ptr (gimple gs, size_t i)
+gimple_omp_for_incr_ptr (gimple *gs, size_t i)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4674,7 +5394,7 @@ gimple_omp_for_incr_ptr (gimple gs, size_t i)
 /* Set INCR to be the increment value for the OMP_FOR statement GS.  */
 
 static inline void
-gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
+gimple_omp_for_set_incr (gimple *gs, size_t i, tree incr)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
@@ -4686,7 +5406,7 @@ gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
    statement GS starts.  */
 
 static inline gimple_seq *
-gimple_omp_for_pre_body_ptr (gimple gs)
+gimple_omp_for_pre_body_ptr (gimple *gs)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   return &omp_for_stmt->pre_body;
@@ -4697,9 +5417,9 @@ gimple_omp_for_pre_body_ptr (gimple gs)
    statement GS starts.  */
 
 static inline gimple_seq
-gimple_omp_for_pre_body (gimple gs)
+gimple_omp_for_pre_body (const gimple *gs)
 {
-  return *gimple_omp_for_pre_body_ptr (gs);
+  return *gimple_omp_for_pre_body_ptr (const_cast <gimple *> (gs));
 }
 
 
@@ -4707,17 +5427,86 @@ gimple_omp_for_pre_body (gimple gs)
    OMP_FOR statement GS starts.  */
 
 static inline void
-gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
+gimple_omp_for_set_pre_body (gimple *gs, gimple_seq pre_body)
 {
   gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
   omp_for_stmt->pre_body = pre_body;
 }
 
+/* Return the kernel_phony of OMP_FOR statement.  */
+
+static inline bool
+gimple_omp_for_grid_phony (const gomp_for *omp_for)
+{
+  gcc_checking_assert (gimple_omp_for_kind (omp_for)
+                      != GF_OMP_FOR_KIND_GRID_LOOP);
+  return (gimple_omp_subcode (omp_for) & GF_OMP_FOR_GRID_PHONY) != 0;
+}
+
+/* Set kernel_phony flag of OMP_FOR to VALUE.  */
+
+static inline void
+gimple_omp_for_set_grid_phony (gomp_for *omp_for, bool value)
+{
+  gcc_checking_assert (gimple_omp_for_kind (omp_for)
+                      != GF_OMP_FOR_KIND_GRID_LOOP);
+  if (value)
+    omp_for->subcode |= GF_OMP_FOR_GRID_PHONY;
+  else
+    omp_for->subcode &= ~GF_OMP_FOR_GRID_PHONY;
+}
+
+/* Return the kernel_intra_group of a GRID_LOOP OMP_FOR statement.  */
+
+static inline bool
+gimple_omp_for_grid_intra_group (const gomp_for *omp_for)
+{
+  gcc_checking_assert (gimple_omp_for_kind (omp_for)
+                      == GF_OMP_FOR_KIND_GRID_LOOP);
+  return (gimple_omp_subcode (omp_for) & GF_OMP_FOR_GRID_INTRA_GROUP) != 0;
+}
+
+/* Set kernel_intra_group flag of OMP_FOR to VALUE.  */
+
+static inline void
+gimple_omp_for_set_grid_intra_group (gomp_for *omp_for, bool value)
+{
+  gcc_checking_assert (gimple_omp_for_kind (omp_for)
+                      == GF_OMP_FOR_KIND_GRID_LOOP);
+  if (value)
+    omp_for->subcode |= GF_OMP_FOR_GRID_INTRA_GROUP;
+  else
+    omp_for->subcode &= ~GF_OMP_FOR_GRID_INTRA_GROUP;
+}
+
+/* Return true if iterations of a grid OMP_FOR statement correspond to HSA
+   groups.  */
+
+static inline bool
+gimple_omp_for_grid_group_iter (const gomp_for *omp_for)
+{
+  gcc_checking_assert (gimple_omp_for_kind (omp_for)
+                      == GF_OMP_FOR_KIND_GRID_LOOP);
+  return (gimple_omp_subcode (omp_for) & GF_OMP_FOR_GRID_GROUP_ITER) != 0;
+}
+
+/* Set group_iter flag of OMP_FOR to VALUE.  */
+
+static inline void
+gimple_omp_for_set_grid_group_iter (gomp_for *omp_for, bool value)
+{
+  gcc_checking_assert (gimple_omp_for_kind (omp_for)
+                      == GF_OMP_FOR_KIND_GRID_LOOP);
+  if (value)
+    omp_for->subcode |= GF_OMP_FOR_GRID_GROUP_ITER;
+  else
+    omp_for->subcode &= ~GF_OMP_FOR_GRID_GROUP_ITER;
+}
 
 /* Return the clauses associated with OMP_PARALLEL GS.  */
 
 static inline tree
-gimple_omp_parallel_clauses (const_gimple gs)
+gimple_omp_parallel_clauses (const gimple *gs)
 {
   const gomp_parallel *omp_parallel_stmt = as_a <const gomp_parallel *> (gs);
   return omp_parallel_stmt->clauses;
@@ -4799,11 +5588,29 @@ gimple_omp_parallel_set_data_arg (gomp_parallel *omp_parallel_stmt,
   omp_parallel_stmt->data_arg = data_arg;
 }
 
+/* Return the kernel_phony flag of OMP_PARALLEL_STMT.  */
+
+static inline bool
+gimple_omp_parallel_grid_phony (const gomp_parallel *stmt)
+{
+  return (gimple_omp_subcode (stmt) & GF_OMP_PARALLEL_GRID_PHONY) != 0;
+}
+
+/* Set kernel_phony flag of OMP_PARALLEL_STMT to VALUE.  */
+
+static inline void
+gimple_omp_parallel_set_grid_phony (gomp_parallel *stmt, bool value)
+{
+  if (value)
+    stmt->subcode |= GF_OMP_PARALLEL_GRID_PHONY;
+  else
+    stmt->subcode &= ~GF_OMP_PARALLEL_GRID_PHONY;
+}
 
 /* Return the clauses associated with OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_task_clauses (const_gimple gs)
+gimple_omp_task_clauses (const gimple *gs)
 {
   const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
   return omp_task_stmt->clauses;
@@ -4813,7 +5620,7 @@ gimple_omp_task_clauses (const_gimple gs)
 /* Return a pointer to the clauses associated with OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_task_clauses_ptr (gimple gs)
+gimple_omp_task_clauses_ptr (gimple *gs)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   return &omp_task_stmt->clauses;
@@ -4824,17 +5631,67 @@ gimple_omp_task_clauses_ptr (gimple gs)
    GS.  */
 
 static inline void
-gimple_omp_task_set_clauses (gimple gs, tree clauses)
+gimple_omp_task_set_clauses (gimple *gs, tree clauses)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   omp_task_stmt->clauses = clauses;
 }
 
 
+/* Return true if OMP task statement G has the
+   GF_OMP_TASK_TASKLOOP flag set.  */
+
+static inline bool
+gimple_omp_task_taskloop_p (const gimple *g)
+{
+  GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
+  return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKLOOP) != 0;
+}
+
+
+/* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
+   value of TASKLOOP_P.  */
+
+static inline void
+gimple_omp_task_set_taskloop_p (gimple *g, bool taskloop_p)
+{
+  GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
+  if (taskloop_p)
+    g->subcode |= GF_OMP_TASK_TASKLOOP;
+  else
+    g->subcode &= ~GF_OMP_TASK_TASKLOOP;
+}
+
+
+/* Return true if OMP task statement G has the
+   GF_OMP_TASK_TASKWAIT flag set.  */
+
+static inline bool
+gimple_omp_task_taskwait_p (const gimple *g)
+{
+  GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
+  return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKWAIT) != 0;
+}
+
+
+/* Set the GF_OMP_TASK_TASKWAIT field in G depending on the boolean
+   value of TASKWAIT_P.  */
+
+static inline void
+gimple_omp_task_set_taskwait_p (gimple *g, bool taskwait_p)
+{
+  GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
+  if (taskwait_p)
+    g->subcode |= GF_OMP_TASK_TASKWAIT;
+  else
+    g->subcode &= ~GF_OMP_TASK_TASKWAIT;
+}
+
+
 /* Return the child function used to hold the body of OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_task_child_fn (const_gimple gs)
+gimple_omp_task_child_fn (const gimple *gs)
 {
   const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
   return omp_task_stmt->child_fn;
@@ -4844,7 +5701,7 @@ gimple_omp_task_child_fn (const_gimple gs)
    OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_task_child_fn_ptr (gimple gs)
+gimple_omp_task_child_fn_ptr (gimple *gs)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   return &omp_task_stmt->child_fn;
@@ -4854,7 +5711,7 @@ gimple_omp_task_child_fn_ptr (gimple gs)
 /* Set CHILD_FN to be the child function for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
+gimple_omp_task_set_child_fn (gimple *gs, tree child_fn)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   omp_task_stmt->child_fn = child_fn;
@@ -4865,7 +5722,7 @@ gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
    from the parent to the children threads in OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_task_data_arg (const_gimple gs)
+gimple_omp_task_data_arg (const gimple *gs)
 {
   const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
   return omp_task_stmt->data_arg;
@@ -4875,7 +5732,7 @@ gimple_omp_task_data_arg (const_gimple gs)
 /* Return a pointer to the data argument for OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_task_data_arg_ptr (gimple gs)
+gimple_omp_task_data_arg_ptr (gimple *gs)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   return &omp_task_stmt->data_arg;
@@ -4885,7 +5742,7 @@ gimple_omp_task_data_arg_ptr (gimple gs)
 /* Set DATA_ARG to be the data argument for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
+gimple_omp_task_set_data_arg (gimple *gs, tree data_arg)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   omp_task_stmt->data_arg = data_arg;
@@ -4895,7 +5752,7 @@ gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
 /* Return the clauses associated with OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_taskreg_clauses (const_gimple gs)
+gimple_omp_taskreg_clauses (const gimple *gs)
 {
   const gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <const gimple_statement_omp_taskreg *> (gs);
@@ -4906,7 +5763,7 @@ gimple_omp_taskreg_clauses (const_gimple gs)
 /* Return a pointer to the clauses associated with OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_taskreg_clauses_ptr (gimple gs)
+gimple_omp_taskreg_clauses_ptr (gimple *gs)
 {
   gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <gimple_statement_omp_taskreg *> (gs);
@@ -4918,7 +5775,7 @@ gimple_omp_taskreg_clauses_ptr (gimple gs)
    GS.  */
 
 static inline void
-gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
+gimple_omp_taskreg_set_clauses (gimple *gs, tree clauses)
 {
   gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <gimple_statement_omp_taskreg *> (gs);
@@ -4929,7 +5786,7 @@ gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
 /* Return the child function used to hold the body of OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_taskreg_child_fn (const_gimple gs)
+gimple_omp_taskreg_child_fn (const gimple *gs)
 {
   const gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <const gimple_statement_omp_taskreg *> (gs);
@@ -4940,7 +5797,7 @@ gimple_omp_taskreg_child_fn (const_gimple gs)
    OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_taskreg_child_fn_ptr (gimple gs)
+gimple_omp_taskreg_child_fn_ptr (gimple *gs)
 {
   gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <gimple_statement_omp_taskreg *> (gs);
@@ -4951,7 +5808,7 @@ gimple_omp_taskreg_child_fn_ptr (gimple gs)
 /* Set CHILD_FN to be the child function for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
+gimple_omp_taskreg_set_child_fn (gimple *gs, tree child_fn)
 {
   gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <gimple_statement_omp_taskreg *> (gs);
@@ -4963,7 +5820,7 @@ gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
    from the parent to the children threads in OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_taskreg_data_arg (const_gimple gs)
+gimple_omp_taskreg_data_arg (const gimple *gs)
 {
   const gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <const gimple_statement_omp_taskreg *> (gs);
@@ -4974,7 +5831,7 @@ gimple_omp_taskreg_data_arg (const_gimple gs)
 /* Return a pointer to the data argument for OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_taskreg_data_arg_ptr (gimple gs)
+gimple_omp_taskreg_data_arg_ptr (gimple *gs)
 {
   gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <gimple_statement_omp_taskreg *> (gs);
@@ -4985,7 +5842,7 @@ gimple_omp_taskreg_data_arg_ptr (gimple gs)
 /* Set DATA_ARG to be the data argument for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
+gimple_omp_taskreg_set_data_arg (gimple *gs, tree data_arg)
 {
   gimple_statement_omp_taskreg *omp_taskreg_stmt
     = as_a <gimple_statement_omp_taskreg *> (gs);
@@ -4996,7 +5853,7 @@ gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
 /* Return the copy function used to hold the body of OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_task_copy_fn (const_gimple gs)
+gimple_omp_task_copy_fn (const gimple *gs)
 {
   const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
   return omp_task_stmt->copy_fn;
@@ -5006,7 +5863,7 @@ gimple_omp_task_copy_fn (const_gimple gs)
    OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_task_copy_fn_ptr (gimple gs)
+gimple_omp_task_copy_fn_ptr (gimple *gs)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   return &omp_task_stmt->copy_fn;
@@ -5016,7 +5873,7 @@ gimple_omp_task_copy_fn_ptr (gimple gs)
 /* Set CHILD_FN to be the copy function for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
+gimple_omp_task_set_copy_fn (gimple *gs, tree copy_fn)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   omp_task_stmt->copy_fn = copy_fn;
@@ -5026,7 +5883,7 @@ gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
 /* Return size of the data block in bytes in OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_task_arg_size (const_gimple gs)
+gimple_omp_task_arg_size (const gimple *gs)
 {
   const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
   return omp_task_stmt->arg_size;
@@ -5036,7 +5893,7 @@ gimple_omp_task_arg_size (const_gimple gs)
 /* Return a pointer to the data block size for OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_task_arg_size_ptr (gimple gs)
+gimple_omp_task_arg_size_ptr (gimple *gs)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   return &omp_task_stmt->arg_size;
@@ -5046,7 +5903,7 @@ gimple_omp_task_arg_size_ptr (gimple gs)
 /* Set ARG_SIZE to be the data block size for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
+gimple_omp_task_set_arg_size (gimple *gs, tree arg_size)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   omp_task_stmt->arg_size = arg_size;
@@ -5056,7 +5913,7 @@ gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
 /* Return align of the data block in bytes in OMP_TASK GS.  */
 
 static inline tree
-gimple_omp_task_arg_align (const_gimple gs)
+gimple_omp_task_arg_align (const gimple *gs)
 {
   const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
   return omp_task_stmt->arg_align;
@@ -5066,7 +5923,7 @@ gimple_omp_task_arg_align (const_gimple gs)
 /* Return a pointer to the data block align for OMP_TASK GS.  */
 
 static inline tree *
-gimple_omp_task_arg_align_ptr (gimple gs)
+gimple_omp_task_arg_align_ptr (gimple *gs)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   return &omp_task_stmt->arg_align;
@@ -5076,7 +5933,7 @@ gimple_omp_task_arg_align_ptr (gimple gs)
 /* Set ARG_SIZE to be the data block align for OMP_TASK GS.  */
 
 static inline void
-gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
+gimple_omp_task_set_arg_align (gimple *gs, tree arg_align)
 {
   gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
   omp_task_stmt->arg_align = arg_align;
@@ -5086,7 +5943,7 @@ gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
 /* Return the clauses associated with OMP_SINGLE GS.  */
 
 static inline tree
-gimple_omp_single_clauses (const_gimple gs)
+gimple_omp_single_clauses (const gimple *gs)
 {
   const gomp_single *omp_single_stmt = as_a <const gomp_single *> (gs);
   return omp_single_stmt->clauses;
@@ -5096,7 +5953,7 @@ gimple_omp_single_clauses (const_gimple gs)
 /* Return a pointer to the clauses associated with OMP_SINGLE GS.  */
 
 static inline tree *
-gimple_omp_single_clauses_ptr (gimple gs)
+gimple_omp_single_clauses_ptr (gimple *gs)
 {
   gomp_single *omp_single_stmt = as_a <gomp_single *> (gs);
   return &omp_single_stmt->clauses;
@@ -5115,7 +5972,7 @@ gimple_omp_single_set_clauses (gomp_single *omp_single_stmt, tree clauses)
 /* Return the clauses associated with OMP_TARGET GS.  */
 
 static inline tree
-gimple_omp_target_clauses (const_gimple gs)
+gimple_omp_target_clauses (const gimple *gs)
 {
   const gomp_target *omp_target_stmt = as_a <const gomp_target *> (gs);
   return omp_target_stmt->clauses;
@@ -5125,7 +5982,7 @@ gimple_omp_target_clauses (const_gimple gs)
 /* Return a pointer to the clauses associated with OMP_TARGET GS.  */
 
 static inline tree *
-gimple_omp_target_clauses_ptr (gimple gs)
+gimple_omp_target_clauses_ptr (gimple *gs)
 {
   gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
   return &omp_target_stmt->clauses;
@@ -5145,7 +6002,7 @@ gimple_omp_target_set_clauses (gomp_target *omp_target_stmt,
 /* Return the kind of the OMP_TARGET G.  */
 
 static inline int
-gimple_omp_target_kind (const_gimple g)
+gimple_omp_target_kind (const gimple *g)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
   return (gimple_omp_subcode (g) & GF_OMP_TARGET_KIND_MASK);
@@ -5222,7 +6079,7 @@ gimple_omp_target_set_data_arg (gomp_target *omp_target_stmt,
 /* Return the clauses associated with OMP_TEAMS GS.  */
 
 static inline tree
-gimple_omp_teams_clauses (const_gimple gs)
+gimple_omp_teams_clauses (const gimple *gs)
 {
   const gomp_teams *omp_teams_stmt = as_a <const gomp_teams *> (gs);
   return omp_teams_stmt->clauses;
@@ -5232,7 +6089,7 @@ gimple_omp_teams_clauses (const_gimple gs)
 /* Return a pointer to the clauses associated with OMP_TEAMS GS.  */
 
 static inline tree *
-gimple_omp_teams_clauses_ptr (gimple gs)
+gimple_omp_teams_clauses_ptr (gimple *gs)
 {
   gomp_teams *omp_teams_stmt = as_a <gomp_teams *> (gs);
   return &omp_teams_stmt->clauses;
@@ -5247,11 +6104,102 @@ gimple_omp_teams_set_clauses (gomp_teams *omp_teams_stmt, tree clauses)
   omp_teams_stmt->clauses = clauses;
 }
 
+/* Return the child function used to hold the body of OMP_TEAMS_STMT.  */
+
+static inline tree
+gimple_omp_teams_child_fn (const gomp_teams *omp_teams_stmt)
+{
+  return omp_teams_stmt->child_fn;
+}
+
+/* Return a pointer to the child function used to hold the body of
+   OMP_TEAMS_STMT.  */
+
+static inline tree *
+gimple_omp_teams_child_fn_ptr (gomp_teams *omp_teams_stmt)
+{
+  return &omp_teams_stmt->child_fn;
+}
+
+
+/* Set CHILD_FN to be the child function for OMP_TEAMS_STMT.  */
+
+static inline void
+gimple_omp_teams_set_child_fn (gomp_teams *omp_teams_stmt, tree child_fn)
+{
+  omp_teams_stmt->child_fn = child_fn;
+}
+
+
+/* Return the artificial argument used to send variables and values
+   from the parent to the children threads in OMP_TEAMS_STMT.  */
+
+static inline tree
+gimple_omp_teams_data_arg (const gomp_teams *omp_teams_stmt)
+{
+  return omp_teams_stmt->data_arg;
+}
+
+
+/* Return a pointer to the data argument for OMP_TEAMS_STMT.  */
+
+static inline tree *
+gimple_omp_teams_data_arg_ptr (gomp_teams *omp_teams_stmt)
+{
+  return &omp_teams_stmt->data_arg;
+}
+
+
+/* Set DATA_ARG to be the data argument for OMP_TEAMS_STMT.  */
+
+static inline void
+gimple_omp_teams_set_data_arg (gomp_teams *omp_teams_stmt, tree data_arg)
+{
+  omp_teams_stmt->data_arg = data_arg;
+}
+
+/* Return the kernel_phony flag of an OMP_TEAMS_STMT.  */
+
+static inline bool
+gimple_omp_teams_grid_phony (const gomp_teams *omp_teams_stmt)
+{
+  return (gimple_omp_subcode (omp_teams_stmt) & GF_OMP_TEAMS_GRID_PHONY) != 0;
+}
+
+/* Set kernel_phony flag of an OMP_TEAMS_STMT to VALUE.  */
+
+static inline void
+gimple_omp_teams_set_grid_phony (gomp_teams *omp_teams_stmt, bool value)
+{
+  if (value)
+    omp_teams_stmt->subcode |= GF_OMP_TEAMS_GRID_PHONY;
+  else
+    omp_teams_stmt->subcode &= ~GF_OMP_TEAMS_GRID_PHONY;
+}
+
+/* Return the host flag of an OMP_TEAMS_STMT.  */
+
+static inline bool
+gimple_omp_teams_host (const gomp_teams *omp_teams_stmt)
+{
+  return (gimple_omp_subcode (omp_teams_stmt) & GF_OMP_TEAMS_HOST) != 0;
+}
+
+/* Set host flag of an OMP_TEAMS_STMT to VALUE.  */
+
+static inline void
+gimple_omp_teams_set_host (gomp_teams *omp_teams_stmt, bool value)
+{
+  if (value)
+    omp_teams_stmt->subcode |= GF_OMP_TEAMS_HOST;
+  else
+    omp_teams_stmt->subcode &= ~GF_OMP_TEAMS_HOST;
+}
 
 /* Return the clauses associated with OMP_SECTIONS GS.  */
 
 static inline tree
-gimple_omp_sections_clauses (const_gimple gs)
+gimple_omp_sections_clauses (const gimple *gs)
 {
   const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
   return omp_sections_stmt->clauses;
@@ -5261,7 +6209,7 @@ gimple_omp_sections_clauses (const_gimple gs)
 /* Return a pointer to the clauses associated with OMP_SECTIONS GS.  */
 
 static inline tree *
-gimple_omp_sections_clauses_ptr (gimple gs)
+gimple_omp_sections_clauses_ptr (gimple *gs)
 {
   gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
   return &omp_sections_stmt->clauses;
@@ -5272,7 +6220,7 @@ gimple_omp_sections_clauses_ptr (gimple gs)
    GS.  */
 
 static inline void
-gimple_omp_sections_set_clauses (gimple gs, tree clauses)
+gimple_omp_sections_set_clauses (gimple *gs, tree clauses)
 {
   gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
   omp_sections_stmt->clauses = clauses;
@@ -5283,7 +6231,7 @@ gimple_omp_sections_set_clauses (gimple gs, tree clauses)
    in GS.  */
 
 static inline tree
-gimple_omp_sections_control (const_gimple gs)
+gimple_omp_sections_control (const gimple *gs)
 {
   const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
   return omp_sections_stmt->control;
@@ -5294,7 +6242,7 @@ gimple_omp_sections_control (const_gimple gs)
    GS.  */
 
 static inline tree *
-gimple_omp_sections_control_ptr (gimple gs)
+gimple_omp_sections_control_ptr (gimple *gs)
 {
   gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
   return &omp_sections_stmt->control;
@@ -5305,7 +6253,7 @@ gimple_omp_sections_control_ptr (gimple gs)
    GIMPLE_OMP_SECTIONS in GS.  */
 
 static inline void
-gimple_omp_sections_set_control (gimple gs, tree control)
+gimple_omp_sections_set_control (gimple *gs, tree control)
 {
   gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
   omp_sections_stmt->control = control;
@@ -5456,23 +6404,47 @@ gimple_transaction_body_ptr (gtransaction *transaction_stmt)
 /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT.  */
 
 static inline gimple_seq
-gimple_transaction_body (gtransaction *transaction_stmt)
+gimple_transaction_body (const gtransaction *transaction_stmt)
 {
-  return *gimple_transaction_body_ptr (transaction_stmt);
+  return transaction_stmt->body;
 }
 
 /* Return the label associated with a GIMPLE_TRANSACTION.  */
 
 static inline tree
-gimple_transaction_label (const gtransaction *transaction_stmt)
+gimple_transaction_label_norm (const gtransaction *transaction_stmt)
+{
+  return transaction_stmt->label_norm;
+}
+
+static inline tree *
+gimple_transaction_label_norm_ptr (gtransaction *transaction_stmt)
+{
+  return &transaction_stmt->label_norm;
+}
+
+static inline tree
+gimple_transaction_label_uninst (const gtransaction *transaction_stmt)
+{
+  return transaction_stmt->label_uninst;
+}
+
+static inline tree *
+gimple_transaction_label_uninst_ptr (gtransaction *transaction_stmt)
+{
+  return &transaction_stmt->label_uninst;
+}
+
+static inline tree
+gimple_transaction_label_over (const gtransaction *transaction_stmt)
 {
-  return transaction_stmt->label;
+  return transaction_stmt->label_over;
 }
 
 static inline tree *
-gimple_transaction_label_ptr (gtransaction *transaction_stmt)
+gimple_transaction_label_over_ptr (gtransaction *transaction_stmt)
 {
-  return &transaction_stmt->label;
+  return &transaction_stmt->label_over;
 }
 
 /* Return the subcode associated with a GIMPLE_TRANSACTION.  */
@@ -5496,9 +6468,21 @@ gimple_transaction_set_body (gtransaction *transaction_stmt,
 /* Set the label associated with a GIMPLE_TRANSACTION.  */
 
 static inline void
-gimple_transaction_set_label (gtransaction *transaction_stmt, tree label)
+gimple_transaction_set_label_norm (gtransaction *transaction_stmt, tree label)
 {
-  transaction_stmt->label = label;
+  transaction_stmt->label_norm = label;
+}
+
+static inline void
+gimple_transaction_set_label_uninst (gtransaction *transaction_stmt, tree label)
+{
+  transaction_stmt->label_uninst = label;
+}
+
+static inline void
+gimple_transaction_set_label_over (gtransaction *transaction_stmt, tree label)
+{
+  transaction_stmt->label_over = label;
 }
 
 /* Set the subcode associated with a GIMPLE_TRANSACTION.  */
@@ -5510,13 +6494,12 @@ gimple_transaction_set_subcode (gtransaction *transaction_stmt,
   transaction_stmt->subcode = subcode;
 }
 
-
 /* Return a pointer to the return value for GIMPLE_RETURN GS.  */
 
 static inline tree *
-gimple_return_retval_ptr (const greturn *gs)
+gimple_return_retval_ptr (greturn *gs)
 {
-  return gimple_op_ptr (gs, 0);
+  return &gs->op[0];
 }
 
 /* Return the return value for GIMPLE_RETURN GS.  */
@@ -5524,7 +6507,7 @@ gimple_return_retval_ptr (const greturn *gs)
 static inline tree
 gimple_return_retval (const greturn *gs)
 {
-  return gimple_op (gs, 0);
+  return gs->op[0];
 }
 
 
@@ -5533,27 +6516,7 @@ gimple_return_retval (const greturn *gs)
 static inline void
 gimple_return_set_retval (greturn *gs, tree retval)
 {
-  gimple_set_op (gs, 0, retval);
-}
-
-
-/* Return the return bounds for GIMPLE_RETURN GS.  */
-
-static inline tree
-gimple_return_retbnd (const_gimple gs)
-{
-  GIMPLE_CHECK (gs, GIMPLE_RETURN);
-  return gimple_op (gs, 1);
-}
-
-
-/* Set RETVAL to be the return bounds for GIMPLE_RETURN GS.  */
-
-static inline void
-gimple_return_set_retbnd (gimple gs, tree retval)
-{
-  GIMPLE_CHECK (gs, GIMPLE_RETURN);
-  gimple_set_op (gs, 1, retval);
+  gs->op[0] = retval;
 }
 
 
@@ -5573,13 +6536,15 @@ gimple_return_set_retbnd (gimple gs, tree retval)
     case GIMPLE_OMP_TASKGROUP:                 \
     case GIMPLE_OMP_ORDERED:                   \
     case GIMPLE_OMP_CRITICAL:                  \
+    case GIMPLE_OMP_SCAN:                      \
     case GIMPLE_OMP_RETURN:                    \
     case GIMPLE_OMP_ATOMIC_LOAD:               \
     case GIMPLE_OMP_ATOMIC_STORE:              \
-    case GIMPLE_OMP_CONTINUE
+    case GIMPLE_OMP_CONTINUE:                  \
+    case GIMPLE_OMP_GRID_BODY
 
 static inline bool
-is_gimple_omp (const_gimple stmt)
+is_gimple_omp (const gimple *stmt)
 {
   switch (gimple_code (stmt))
     {
@@ -5594,7 +6559,7 @@ is_gimple_omp (const_gimple stmt)
    specifically.  */
 
 static inline bool
-is_gimple_omp_oacc (const_gimple stmt)
+is_gimple_omp_oacc (const gimple *stmt)
 {
   gcc_assert (is_gimple_omp (stmt));
   switch (gimple_code (stmt))
@@ -5612,9 +6577,12 @@ is_gimple_omp_oacc (const_gimple stmt)
        {
        case GF_OMP_TARGET_KIND_OACC_PARALLEL:
        case GF_OMP_TARGET_KIND_OACC_KERNELS:
+       case GF_OMP_TARGET_KIND_OACC_SERIAL:
        case GF_OMP_TARGET_KIND_OACC_DATA:
        case GF_OMP_TARGET_KIND_OACC_UPDATE:
        case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA:
+       case GF_OMP_TARGET_KIND_OACC_DECLARE:
+       case GF_OMP_TARGET_KIND_OACC_HOST_DATA:
          return true;
        default:
          return false;
@@ -5628,7 +6596,7 @@ is_gimple_omp_oacc (const_gimple stmt)
 /* Return true if the OMP gimple statement STMT is offloaded.  */
 
 static inline bool
-is_gimple_omp_offloaded (const_gimple stmt)
+is_gimple_omp_offloaded (const gimple *stmt)
 {
   gcc_assert (is_gimple_omp (stmt));
   switch (gimple_code (stmt))
@@ -5639,6 +6607,7 @@ is_gimple_omp_offloaded (const_gimple stmt)
        case GF_OMP_TARGET_KIND_REGION:
        case GF_OMP_TARGET_KIND_OACC_PARALLEL:
        case GF_OMP_TARGET_KIND_OACC_KERNELS:
+       case GF_OMP_TARGET_KIND_OACC_SERIAL:
          return true;
        default:
          return false;
@@ -5652,7 +6621,7 @@ is_gimple_omp_offloaded (const_gimple stmt)
 /* Returns TRUE if statement G is a GIMPLE_NOP.  */
 
 static inline bool
-gimple_nop_p (const_gimple g)
+gimple_nop_p (const gimple *g)
 {
   return gimple_code (g) == GIMPLE_NOP;
 }
@@ -5661,92 +6630,45 @@ gimple_nop_p (const_gimple g)
 /* Return true if GS is a GIMPLE_RESX.  */
 
 static inline bool
-is_gimple_resx (const_gimple gs)
+is_gimple_resx (const gimple *gs)
 {
   return gimple_code (gs) == GIMPLE_RESX;
 }
 
-/* Return the predictor of GIMPLE_PREDICT statement GS.  */
-
-static inline enum br_predictor
-gimple_predict_predictor (gimple gs)
-{
-  GIMPLE_CHECK (gs, GIMPLE_PREDICT);
-  return (enum br_predictor) (gs->subcode & ~GF_PREDICT_TAKEN);
-}
-
-
-/* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT.  */
-
-static inline void
-gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
-{
-  GIMPLE_CHECK (gs, GIMPLE_PREDICT);
-  gs->subcode = (gs->subcode & GF_PREDICT_TAKEN)
-                      | (unsigned) predictor;
-}
-
-
-/* Return the outcome of GIMPLE_PREDICT statement GS.  */
-
-static inline enum prediction
-gimple_predict_outcome (gimple gs)
-{
-  GIMPLE_CHECK (gs, GIMPLE_PREDICT);
-  return (gs->subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
-}
-
-
-/* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME.  */
-
-static inline void
-gimple_predict_set_outcome (gimple gs, enum prediction outcome)
-{
-  GIMPLE_CHECK (gs, GIMPLE_PREDICT);
-  if (outcome == TAKEN)
-    gs->subcode |= GF_PREDICT_TAKEN;
-  else
-    gs->subcode &= ~GF_PREDICT_TAKEN;
-}
-
-
 /* Return the type of the main expression computed by STMT.  Return
    void_type_node if the statement computes nothing.  */
 
 static inline tree
-gimple_expr_type (const_gimple stmt)
+gimple_expr_type (const gimple *stmt)
 {
   enum gimple_code code = gimple_code (stmt);
-
-  if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
+  /* In general we want to pass out a type that can be substituted
+     for both the RHS and the LHS types if there is a possibly
+     useless conversion involved.  That means returning the
+     original RHS type as far as we can reconstruct it.  */
+  if (code == GIMPLE_CALL)
     {
-      tree type;
-      /* In general we want to pass out a type that can be substituted
-         for both the RHS and the LHS types if there is a possibly
-        useless conversion involved.  That means returning the
-        original RHS type as far as we can reconstruct it.  */
-      if (code == GIMPLE_CALL)
-       {
-         const gcall *call_stmt = as_a <const gcall *> (stmt);
-         if (gimple_call_internal_p (call_stmt)
-             && gimple_call_internal_fn (call_stmt) == IFN_MASK_STORE)
-           type = TREE_TYPE (gimple_call_arg (call_stmt, 3));
-         else
-           type = gimple_call_return_type (call_stmt);
-       }
-      else
-       switch (gimple_assign_rhs_code (stmt))
+      const gcall *call_stmt = as_a <const gcall *> (stmt);
+      if (gimple_call_internal_p (call_stmt))
+       switch (gimple_call_internal_fn (call_stmt))
          {
-         case POINTER_PLUS_EXPR:
-           type = TREE_TYPE (gimple_assign_rhs1 (stmt));
-           break;
-
+         case IFN_MASK_STORE:
+         case IFN_SCATTER_STORE:
+           return TREE_TYPE (gimple_call_arg (call_stmt, 3));
+         case IFN_MASK_SCATTER_STORE:
+           return TREE_TYPE (gimple_call_arg (call_stmt, 4));
          default:
-           /* As fallback use the type of the LHS.  */
-           type = TREE_TYPE (gimple_get_lhs (stmt));
            break;
          }
-      return type;
+      return gimple_call_return_type (call_stmt);
+    }
+  else if (code == GIMPLE_ASSIGN)
+    {
+      if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+        return TREE_TYPE (gimple_assign_rhs1 (stmt));
+      else
+        /* As fallback use the type of the LHS.  */
+        return TREE_TYPE (gimple_get_lhs (stmt));
     }
   else if (code == GIMPLE_COND)
     return boolean_type_node;
@@ -5765,8 +6687,8 @@ enum gimple_alloc_kind
   gimple_alloc_kind_all
 };
 
-extern int gimple_alloc_counts[];
-extern int gimple_alloc_sizes[];
+extern uint64_t gimple_alloc_counts[];
+extern uint64_t gimple_alloc_sizes[];
 
 /* Return the allocation kind for a given stmt CODE.  */
 static inline enum gimple_alloc_kind
@@ -5789,7 +6711,7 @@ gimple_alloc_kind (enum gimple_code code)
    by annotate_all_with_location.  */
 
 static inline bool
-gimple_do_not_emit_location_p (gimple g)
+gimple_do_not_emit_location_p (gimple *g)
 {
   return gimple_plf (g, GF_PLF_1);
 }
@@ -5798,21 +6720,11 @@ gimple_do_not_emit_location_p (gimple g)
    annotate_one_with_location.  */
 
 static inline void
-gimple_set_do_not_emit_location (gimple g)
+gimple_set_do_not_emit_location (gimple *g)
 {
   /* The PLF flags are initialized to 0 when a new tuple is created,
      so no need to initialize it anywhere.  */
   gimple_set_plf (g, GF_PLF_1, true);
 }
 
-
-/* Macros for showing usage statistics.  */
-#define SCALE(x) ((unsigned long) ((x) < 1024*10       \
-                 ? (x)                                 \
-                 : ((x) < 1024*1024*10                 \
-                    ? (x) / 1024                       \
-                    : (x) / (1024*1024))))
-
-#define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
-
 #endif  /* GCC_GIMPLE_H */