]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix checking of gimple types
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 27 Nov 2013 02:26:25 +0000 (02:26 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 27 Nov 2013 02:26:25 +0000 (02:26 +0000)
* gengtype.c (struct seen_tag): New.
(already_seen_tag): New.
(mark_tag_as_seen): New.
(walk_subclasses): Support having multiple subclasses using the
same tag by tracking which tags have already been seen, and using
this to avoid adding duplicate cases to the "switch" statement.
The call to already_seen_tag introduces an O(N^2) when running
gengtype on N, the number of tags, due to the repeated linear
search, but currently max(N) is relatively small (the number of
GSS codes, which is 26).
(walk_type): Pass in a seen_tag for use by the walk_subclasses
recursion.

* gimple.def (GIMPLE_OMP_ATOMIC_STORE, GIMPLE_OMP_RETURN): Rename
underlying GSS values for these codes (from GSS_OMP_ATOMIC_STORE to
GSS_OMP_ATOMIC_STORE_LAYOUT) to make clear that although
GIMPLE_OMP_RETURN happens to share the data layout of
GIMPLE_OMP_ATOMIC_STORE, they are not otherwise related.
(GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET): Likewise, rename
underlying GSS value from GSS_OMP_PARALLEL to
GSS_OMP_PARALLEL_LAYOUT to make clear that these gimple codes are
not directly related; they merely share in-memory layout.
(GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS): Likewise, rename GSS values
for these two codes from GSS_OMP_SINGLE to GSS_OMP_SINGLE_LAYOUT.

* gsstruct.def (GSS_OMP_PARALLEL, gimple_statement_omp_parallel):
Rename to...
(GSS_OMP_PARALLEL_LAYOUT, gimple_statement_omp_parallel_layout):
...these.
(GSS_OMP_SINGLE, gimple_statement_omp_single): Rename to...
(GSS_OMP_SINGLE_LAYOUT, gimple_statement_omp_single_layout):
...these.
(GSS_OMP_ATOMIC_STORE, gimple_statement_omp_atomic_store): Rename
to...
(GSS_OMP_ATOMIC_STORE_LAYOUT, gimple_statement_omp_atomic_store):
...these.

* gimple.h (gimple_statement_resx): New subclass of
gimple_statement_eh_ctrl, with the invariant that
stmt->code == GIMPLE_RESX.
(gimple_statement_eh_dispatch): New subclass of
gimple_statement_eh_ctrl, with the invariant that
stmt->code == GIMPLE_EH_DISPATH.

(gimple_statement_omp_parallel): The existing class expressed
a layout (GSS_OMP_PARALLEL), but the codes with that layout
are not all related, so it makes more sense for this class to
express a *code* (GIMPLE_OMP_PARALLEL).  GSS_OMP_PARALLEL has
been renamed to GSS_OMP_PARALLEL_LAYOUT to express this, so
rename the existing gimple_statement_omp_parallel class to...
(gimple_statement_omp_parallel_layout): ...this, expressing
a statement of structure layout GSS_OMP_PARALLEL_LAYOUT.
(gimple_statement_omp_taskreg): New subclass of
gimple_statement_omp_parallel_layout, expressing the invariant
that the code is one of GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK,
as used by the various gimple_omp_taskreg_ accessors.
(gimple_statement_omp_parallel): Reintroduce this class, this time
as a subclass of gimple_statement_omp_taskreg to express the
invariant stmt->code == GIMPLE_OMP_PARALLEL.
(gimple_statement_omp_target) New class, subclassing
gimple_statement_omp_parallel_layout, to express the invariant
stmt->code == GIMPLE_OMP_TARGET.
(gimple_statement_omp_task): Update to inherit from
gimple_statement_omp_taskreg rather than
gimple_statement_omp_parallel.

(gimple_statement_omp_single): Rename to...
(gimple_statement_omp_single_layout): ...this, expressing the
invariant that the layout is GSS_OMP_SINGLE_LAYOUT.
(gimple_statement_omp_single): ...and reintroduce this name as
a subclass of gimple_statement_omp_single_layout, expressing
the invariant that code == GIMPLE_OMP_SINGLE.
(gimple_statement_omp_teams): New class, subclassing
gimple_statement_omp_single_layout, for the code GIMPLE_OMP_TEAMS.

(gimple_statement_omp_atomic_store): Rename to...
(gimple_statement_omp_atomic_store_layout): ...this, expressing
the invariant that the layout is GSS_OMP_ATOMIC_STORE_LAYOUT.
(gimple_statement_omp_atomic_store): ...and reintroduce this
name as a subclass of gimple_statement_omp_atomic_store_layout
with code == GIMPLE_OMP_ATOMIC_STORE.
(gimple_statement_omp_return): New class, subclassing
gimple_statement_omp_atomic_store_layout for the code
GIMPLE_OMP_RETURN.

(is_a_helper <gimple_statement_eh_ctrl>::test): Delete.
(is_a_helper <gimple_statement_resx>::test): New.
(is_a_helper <gimple_statement_eh_dispatch>::test): New.
(is_a_helper <gimple_statement_omp_atomic_store>::test): Only
check for GIMPLE_OMP_ATOMIC_STORE, not for GIMPLE_OMP_RETURN.
(is_a_helper <gimple_statement_omp_return>::test): New.
(is_a_helper <gimple_statement_omp_taskreg>::test): New.
(is_a_helper <gimple_statement_omp_parallel>::test): Only check
for GIMPLE_OMP_PARALLEL, not for GIMPLE_OMP_TASK or
GIMPLE_OMP_TARGET.
(is_a_helper <gimple_statement_omp_target>::test): New.
(is_a_helper <gimple_statement_omp_single>::test): Only check
for GIMPLE_OMP_SINGLE, not for GIMPLE_OMP_TEAMS.
(is_a_helper <gimple_statement_omp_teams>::test): New.

(is_a_helper <const gimple_statement_eh_ctrl>::test): Delete.
(is_a_helper <const gimple_statement_resx>::test): New.
(is_a_helper <const gimple_statement_eh_dispatch>::test): New.
(is_a_helper <const gimple_statement_omp_atomic_store>::test): Only
check for GIMPLE_OMP_ATOMIC_STORE, not for GIMPLE_OMP_RETURN.
(is_a_helper <const gimple_statement_omp_return>::test): New.
(is_a_helper <const gimple_statement_omp_taskreg>::test): New.
(is_a_helper <const gimple_statement_omp_parallel>::test): Only
check for GIMPLE_OMP_PARALLEL, not for GIMPLE_OMP_TASK or
GIMPLE_OMP_TARGET.
(is_a_helper <const gimple_statement_omp_target>::test): New.
(is_a_helper <const gimple_statement_omp_single>::test): Only
check for GIMPLE_OMP_SINGLE, not for GIMPLE_OMP_TEAMS.
(is_a_helper <const gimple_statement_omp_teams>::test): New.

(gimple_omp_return_set_lhs, gimple_omp_return_lhs,
gimple_omp_return_lhs_ptr): Replace bogus downcasts to
gimple_statement_omp_atomic_store with downcasts to
gimple_statement_omp_return, thus requiring that the code be
GIMPLE_OMP_RETURN.
(gimple_resx_region, gimple_resx_set_region): Replace bogus
downcasts to gimple_statement_eh_ctrl with downcasts to
gimple_statement_resx, thus requiring that the code be
GIMPLE_RESX.
(gimple_eh_dispatch_region, gimple_eh_dispatch_set_region):
Replace bogus downcasts to const gimple_statement_eh_ctrl with
downcasts to gimple_statement_eh_dispatch, thus requiring that
the code be GIMPLE_EH_DISPATCH.
(gimple_omp_taskreg_clauses, gimple_omp_taskreg_clauses_ptr)
gimple_omp_taskreg_set_clauses, gimple_omp_taskreg_child_fn,
gimple_omp_taskreg_child_fn_ptr, gimple_omp_taskreg_set_child_fn,
gimple_omp_taskreg_data_arg, gimple_omp_taskreg_data_arg_ptr,
gimple_omp_taskreg_set_data_arg): Replace bogus downcasts to
gimple_statement_omp_parallel with downcasts to
gimple_statement_omp_taskreg, thus requiring that the code be
either GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK.
(gimple_omp_target_clauses, gimple_omp_target_clauses_ptr
gimple_omp_target_set_clauses, gimple_omp_target_child_fn
gimple_omp_target_child_fn_ptr, gimple_omp_target_set_child_fn
gimple_omp_target_data_arg, gimple_omp_target_data_arg_ptr
gimple_omp_target_set_data_arg): Replace bogus downcasts to
gimple_statement_omp_parallel with downcasts to
gimple_statement_omp_target, thus requiring that the code be
GIMPLE_OMP_TARGET.
(gimple_omp_teams_clauses, gimple_omp_teams_clauses_ptr
gimple_omp_teams_set_clauses): Replace bogus downcasts to
gimple_statement_omp_single with downcasts to
gimple_statement_omp_teams, thus requiring that the code be
GIMPLE_OMP_TEAMS.

* gimple.c (gimple_build_resx): Fix bogus as_a<> to use
gimple_statement_resx.
(gimple_build_eh_dispatch): Fix bogus as_a<> to use
gimple_statement_eh_dispatch.

From-SVN: r205428

gcc/ChangeLog
gcc/gengtype.c
gcc/gimple.c
gcc/gimple.def
gcc/gimple.h
gcc/gsstruct.def

index b50232b79ea77c7584c8e8c5a7e5a82070f8fbc4..abb3b3f56b2ff9c1b0579c4a06a7fce2fa491f83 100644 (file)
@@ -1,3 +1,160 @@
+2013-11-26  David Malcolm  <dmalcolm@redhat.com>
+
+       * gengtype.c (struct seen_tag): New.
+       (already_seen_tag): New.
+       (mark_tag_as_seen): New.
+       (walk_subclasses): Support having multiple subclasses using the
+       same tag by tracking which tags have already been seen, and using
+       this to avoid adding duplicate cases to the "switch" statement.
+       The call to already_seen_tag introduces an O(N^2) when running
+       gengtype on N, the number of tags, due to the repeated linear
+       search, but currently max(N) is relatively small (the number of
+       GSS codes, which is 26).
+       (walk_type): Pass in a seen_tag for use by the walk_subclasses
+       recursion.
+
+       * gimple.def (GIMPLE_OMP_ATOMIC_STORE, GIMPLE_OMP_RETURN): Rename
+       underlying GSS values for these codes (from GSS_OMP_ATOMIC_STORE to
+       GSS_OMP_ATOMIC_STORE_LAYOUT) to make clear that although
+       GIMPLE_OMP_RETURN happens to share the data layout of
+       GIMPLE_OMP_ATOMIC_STORE, they are not otherwise related.
+       (GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET): Likewise, rename
+       underlying GSS value from GSS_OMP_PARALLEL to
+       GSS_OMP_PARALLEL_LAYOUT to make clear that these gimple codes are
+       not directly related; they merely share in-memory layout.
+       (GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS): Likewise, rename GSS values
+       for these two codes from GSS_OMP_SINGLE to GSS_OMP_SINGLE_LAYOUT.
+
+       * gsstruct.def (GSS_OMP_PARALLEL, gimple_statement_omp_parallel):
+       Rename to...
+       (GSS_OMP_PARALLEL_LAYOUT, gimple_statement_omp_parallel_layout):
+       ...these.
+       (GSS_OMP_SINGLE, gimple_statement_omp_single): Rename to...
+       (GSS_OMP_SINGLE_LAYOUT, gimple_statement_omp_single_layout):
+       ...these.
+       (GSS_OMP_ATOMIC_STORE, gimple_statement_omp_atomic_store): Rename
+       to...
+       (GSS_OMP_ATOMIC_STORE_LAYOUT, gimple_statement_omp_atomic_store):
+       ...these.
+
+       * gimple.h (gimple_statement_resx): New subclass of
+       gimple_statement_eh_ctrl, with the invariant that
+       stmt->code == GIMPLE_RESX.
+       (gimple_statement_eh_dispatch): New subclass of
+       gimple_statement_eh_ctrl, with the invariant that
+       stmt->code == GIMPLE_EH_DISPATH.
+
+       (gimple_statement_omp_parallel): The existing class expressed
+       a layout (GSS_OMP_PARALLEL), but the codes with that layout
+       are not all related, so it makes more sense for this class to
+       express a *code* (GIMPLE_OMP_PARALLEL).  GSS_OMP_PARALLEL has
+       been renamed to GSS_OMP_PARALLEL_LAYOUT to express this, so
+       rename the existing gimple_statement_omp_parallel class to...
+       (gimple_statement_omp_parallel_layout): ...this, expressing
+       a statement of structure layout GSS_OMP_PARALLEL_LAYOUT.
+       (gimple_statement_omp_taskreg): New subclass of
+       gimple_statement_omp_parallel_layout, expressing the invariant
+       that the code is one of GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK,
+       as used by the various gimple_omp_taskreg_ accessors.
+       (gimple_statement_omp_parallel): Reintroduce this class, this time
+       as a subclass of gimple_statement_omp_taskreg to express the
+       invariant stmt->code == GIMPLE_OMP_PARALLEL.
+       (gimple_statement_omp_target) New class, subclassing
+       gimple_statement_omp_parallel_layout, to express the invariant
+       stmt->code == GIMPLE_OMP_TARGET.
+       (gimple_statement_omp_task): Update to inherit from
+       gimple_statement_omp_taskreg rather than
+       gimple_statement_omp_parallel.
+
+       (gimple_statement_omp_single): Rename to...
+       (gimple_statement_omp_single_layout): ...this, expressing the
+       invariant that the layout is GSS_OMP_SINGLE_LAYOUT.
+       (gimple_statement_omp_single): ...and reintroduce this name as
+       a subclass of gimple_statement_omp_single_layout, expressing
+       the invariant that code == GIMPLE_OMP_SINGLE.
+       (gimple_statement_omp_teams): New class, subclassing
+       gimple_statement_omp_single_layout, for the code GIMPLE_OMP_TEAMS.
+
+       (gimple_statement_omp_atomic_store): Rename to...
+       (gimple_statement_omp_atomic_store_layout): ...this, expressing
+       the invariant that the layout is GSS_OMP_ATOMIC_STORE_LAYOUT.
+       (gimple_statement_omp_atomic_store): ...and reintroduce this
+       name as a subclass of gimple_statement_omp_atomic_store_layout
+       with code == GIMPLE_OMP_ATOMIC_STORE.
+       (gimple_statement_omp_return): New class, subclassing
+       gimple_statement_omp_atomic_store_layout for the code
+       GIMPLE_OMP_RETURN.
+
+       (is_a_helper <gimple_statement_eh_ctrl>::test): Delete.
+       (is_a_helper <gimple_statement_resx>::test): New.
+       (is_a_helper <gimple_statement_eh_dispatch>::test): New.
+       (is_a_helper <gimple_statement_omp_atomic_store>::test): Only
+       check for GIMPLE_OMP_ATOMIC_STORE, not for GIMPLE_OMP_RETURN.
+       (is_a_helper <gimple_statement_omp_return>::test): New.
+       (is_a_helper <gimple_statement_omp_taskreg>::test): New.
+       (is_a_helper <gimple_statement_omp_parallel>::test): Only check
+       for GIMPLE_OMP_PARALLEL, not for GIMPLE_OMP_TASK or
+       GIMPLE_OMP_TARGET.
+       (is_a_helper <gimple_statement_omp_target>::test): New.
+       (is_a_helper <gimple_statement_omp_single>::test): Only check
+       for GIMPLE_OMP_SINGLE, not for GIMPLE_OMP_TEAMS.
+       (is_a_helper <gimple_statement_omp_teams>::test): New.
+
+       (is_a_helper <const gimple_statement_eh_ctrl>::test): Delete.
+       (is_a_helper <const gimple_statement_resx>::test): New.
+       (is_a_helper <const gimple_statement_eh_dispatch>::test): New.
+       (is_a_helper <const gimple_statement_omp_atomic_store>::test): Only
+       check for GIMPLE_OMP_ATOMIC_STORE, not for GIMPLE_OMP_RETURN.
+       (is_a_helper <const gimple_statement_omp_return>::test): New.
+       (is_a_helper <const gimple_statement_omp_taskreg>::test): New.
+       (is_a_helper <const gimple_statement_omp_parallel>::test): Only
+       check for GIMPLE_OMP_PARALLEL, not for GIMPLE_OMP_TASK or
+       GIMPLE_OMP_TARGET.
+       (is_a_helper <const gimple_statement_omp_target>::test): New.
+       (is_a_helper <const gimple_statement_omp_single>::test): Only
+       check for GIMPLE_OMP_SINGLE, not for GIMPLE_OMP_TEAMS.
+       (is_a_helper <const gimple_statement_omp_teams>::test): New.
+
+       (gimple_omp_return_set_lhs, gimple_omp_return_lhs,
+       gimple_omp_return_lhs_ptr): Replace bogus downcasts to
+       gimple_statement_omp_atomic_store with downcasts to
+       gimple_statement_omp_return, thus requiring that the code be
+       GIMPLE_OMP_RETURN.
+       (gimple_resx_region, gimple_resx_set_region): Replace bogus
+       downcasts to gimple_statement_eh_ctrl with downcasts to
+       gimple_statement_resx, thus requiring that the code be
+       GIMPLE_RESX.
+       (gimple_eh_dispatch_region, gimple_eh_dispatch_set_region):
+       Replace bogus downcasts to const gimple_statement_eh_ctrl with
+       downcasts to gimple_statement_eh_dispatch, thus requiring that
+       the code be GIMPLE_EH_DISPATCH.
+       (gimple_omp_taskreg_clauses, gimple_omp_taskreg_clauses_ptr)
+       gimple_omp_taskreg_set_clauses, gimple_omp_taskreg_child_fn,
+       gimple_omp_taskreg_child_fn_ptr, gimple_omp_taskreg_set_child_fn,
+       gimple_omp_taskreg_data_arg, gimple_omp_taskreg_data_arg_ptr,
+       gimple_omp_taskreg_set_data_arg): Replace bogus downcasts to
+       gimple_statement_omp_parallel with downcasts to
+       gimple_statement_omp_taskreg, thus requiring that the code be
+       either GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK.
+       (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr
+       gimple_omp_target_set_clauses, gimple_omp_target_child_fn
+       gimple_omp_target_child_fn_ptr, gimple_omp_target_set_child_fn
+       gimple_omp_target_data_arg, gimple_omp_target_data_arg_ptr
+       gimple_omp_target_set_data_arg): Replace bogus downcasts to
+       gimple_statement_omp_parallel with downcasts to
+       gimple_statement_omp_target, thus requiring that the code be
+       GIMPLE_OMP_TARGET.
+       (gimple_omp_teams_clauses, gimple_omp_teams_clauses_ptr
+       gimple_omp_teams_set_clauses): Replace bogus downcasts to
+       gimple_statement_omp_single with downcasts to
+       gimple_statement_omp_teams, thus requiring that the code be
+       GIMPLE_OMP_TEAMS.
+
+       * gimple.c (gimple_build_resx): Fix bogus as_a<> to use
+       gimple_statement_resx.
+       (gimple_build_eh_dispatch): Fix bogus as_a<> to use
+       gimple_statement_eh_dispatch.
+
 2013-11-26  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/59014
index e7f98f956b6b0061cd519ab559764c2be1422159..ca7ce4d968e8f46b83603fa0e8a296f3b28aae56 100644 (file)
@@ -2657,15 +2657,48 @@ get_string_option (options_p opt, const char *key)
   return NULL;
 }
 
+/* Machinery for avoiding duplicate tags within switch statements.  */
+struct seen_tag
+{
+  const char *tag;
+  struct seen_tag *next;
+};
+
+int
+already_seen_tag (struct seen_tag *seen_tags, const char *tag)
+{
+  /* Linear search, so O(n^2), but n is currently small.  */
+  while (seen_tags)
+    {
+      if (!strcmp (seen_tags->tag, tag))
+       return 1;
+      seen_tags = seen_tags->next;
+    }
+  /* Not yet seen this tag. */
+  return 0;
+}
+
+void
+mark_tag_as_seen (struct seen_tag **seen_tags, const char *tag)
+{
+  /* Add to front of linked list. */
+  struct seen_tag *new_node = XCNEW (struct seen_tag);
+  new_node->tag = tag;
+  new_node->next = *seen_tags;
+  *seen_tags = new_node;
+}
+
 static void
-walk_subclasses (type_p base, struct walk_type_data *d)
+walk_subclasses (type_p base, struct walk_type_data *d,
+                struct seen_tag **seen_tags)
 {
   for (type_p sub = base->u.s.first_subclass; sub != NULL;
        sub = sub->u.s.next_sibling_class)
     {
       const char *type_tag = get_string_option (sub->u.s.opt, "tag");
-      if (type_tag)
+      if (type_tag && !already_seen_tag (*seen_tags, type_tag))
        {
+         mark_tag_as_seen (seen_tags, type_tag);
          oprintf (d->of, "%*scase %s:\n", d->indent, "", type_tag);
          d->indent += 2;
          oprintf (d->of, "%*s{\n", d->indent, "");
@@ -2681,7 +2714,7 @@ walk_subclasses (type_p base, struct walk_type_data *d)
          oprintf (d->of, "%*sbreak;\n", d->indent, "");
          d->indent -= 2;
        }
-      walk_subclasses (sub, d);
+      walk_subclasses (sub, d, seen_tags);
     }
 }
 
@@ -3228,7 +3261,8 @@ walk_type (type_p t, struct walk_type_data *d)
        else if (desc)
          {
            /* Add cases to handle subclasses.  */
-           walk_subclasses (t, d);
+           struct seen_tag *tags = NULL;
+           walk_subclasses (t, d, &tags);
 
            /* Ensure that if someone forgets a "tag" option that we don't
               silent fail to traverse that subclass's fields.  */
index d3451ac9a47ed987f61389bb0a820a4bbccd6340..ead487e8e5fd189ca45e9ac16b1ae5777dd8344d 100644 (file)
@@ -701,8 +701,8 @@ gimple_build_wce (gimple_seq cleanup)
 gimple
 gimple_build_resx (int region)
 {
-  gimple_statement_eh_ctrl *p =
-    as_a <gimple_statement_eh_ctrl> (
+  gimple_statement_resx *p =
+    as_a <gimple_statement_resx> (
       gimple_build_with_ops (GIMPLE_RESX, ERROR_MARK, 0));
   p->region = region;
   return p;
@@ -751,8 +751,8 @@ gimple_build_switch (tree index, tree default_label, vec<tree> args)
 gimple
 gimple_build_eh_dispatch (int region)
 {
-  gimple_statement_eh_ctrl *p =
-    as_a <gimple_statement_eh_ctrl> (
+  gimple_statement_eh_dispatch *p =
+    as_a <gimple_statement_eh_dispatch> (
       gimple_build_with_ops (GIMPLE_EH_DISPATCH, ERROR_MARK, 0));
   p->region = region;
   return p;
index 07370aedd29ebf1a0d7c29bbb59fcc280b7d7067..ff1ef4307ed77d1f260feb6a6153ae3935d628b9 100644 (file)
@@ -221,7 +221,7 @@ DEFGSCODE(GIMPLE_NOP, "gimple_nop", GSS_BASE)
 DEFGSCODE(GIMPLE_OMP_ATOMIC_LOAD, "gimple_omp_atomic_load",
          GSS_OMP_ATOMIC_LOAD)
 DEFGSCODE(GIMPLE_OMP_ATOMIC_STORE, "gimple_omp_atomic_store",
-         GSS_OMP_ATOMIC_STORE)
+         GSS_OMP_ATOMIC_STORE_LAYOUT)
 
 /* GIMPLE_OMP_CONTINUE marks the location of the loop or sections
    iteration in partially lowered OpenMP code.  */
@@ -300,7 +300,7 @@ DEFGSCODE(GIMPLE_OMP_ORDERED, "gimple_omp_ordered", GSS_OMP)
    DATA_ARG is a local variable in the parent function containing data
    to be shared with CHILD_FN.  This is used to implement all the data
    sharing clauses.  */
-DEFGSCODE(GIMPLE_OMP_PARALLEL, "gimple_omp_parallel", GSS_OMP_PARALLEL)
+DEFGSCODE(GIMPLE_OMP_PARALLEL, "gimple_omp_parallel", GSS_OMP_PARALLEL_LAYOUT)
 
 /* GIMPLE_OMP_TASK <BODY, CLAUSES, CHILD_FN, DATA_ARG, COPY_FN,
                    ARG_SIZE, ARG_ALIGN> represents
@@ -329,7 +329,7 @@ DEFGSCODE(GIMPLE_OMP_PARALLEL, "gimple_omp_parallel", GSS_OMP_PARALLEL)
 DEFGSCODE(GIMPLE_OMP_TASK, "gimple_omp_task", GSS_OMP_TASK)
 
 /* OMP_RETURN marks the end of an OpenMP directive.  */
-DEFGSCODE(GIMPLE_OMP_RETURN, "gimple_omp_return", GSS_OMP_ATOMIC_STORE)
+DEFGSCODE(GIMPLE_OMP_RETURN, "gimple_omp_return", GSS_OMP_ATOMIC_STORE_LAYOUT)
 
 /* OMP_SECTION <BODY> represents #pragma omp section.
    BODY is the sequence of statements in the section body.  */
@@ -351,7 +351,7 @@ DEFGSCODE(GIMPLE_OMP_SECTIONS_SWITCH, "gimple_omp_sections_switch", GSS_BASE)
 /* GIMPLE_OMP_SINGLE <BODY, CLAUSES> represents #pragma omp single
    BODY is the sequence of statements inside the single section.
    CLAUSES is an OMP_CLAUSE chain holding the associated clauses.  */
-DEFGSCODE(GIMPLE_OMP_SINGLE, "gimple_omp_single", GSS_OMP_SINGLE)
+DEFGSCODE(GIMPLE_OMP_SINGLE, "gimple_omp_single", GSS_OMP_SINGLE_LAYOUT)
 
 /* GIMPLE_OMP_TARGET <BODY, CLAUSES, CHILD_FN> represents
    #pragma omp target {,data,update}
@@ -364,12 +364,12 @@ DEFGSCODE(GIMPLE_OMP_SINGLE, "gimple_omp_single", GSS_OMP_SINGLE)
    DATA_ARG is a vec of 3 local variables in the parent function
    containing data to be mapped to CHILD_FN.  This is used to
    implement the MAP clauses.  */
-DEFGSCODE(GIMPLE_OMP_TARGET, "gimple_omp_target", GSS_OMP_PARALLEL)
+DEFGSCODE(GIMPLE_OMP_TARGET, "gimple_omp_target", GSS_OMP_PARALLEL_LAYOUT)
 
 /* GIMPLE_OMP_TEAMS <BODY, CLAUSES> represents #pragma omp teams
    BODY is the sequence of statements inside the single section.
    CLAUSES is an OMP_CLAUSE chain holding the associated clauses.  */
-DEFGSCODE(GIMPLE_OMP_TEAMS, "gimple_omp_teams", GSS_OMP_SINGLE)
+DEFGSCODE(GIMPLE_OMP_TEAMS, "gimple_omp_teams", GSS_OMP_SINGLE_LAYOUT)
 
 /* GIMPLE_PREDICT <PREDICT, OUTCOME> specifies a hint for branch prediction.
 
index c9977329e4fc37552bec6918b42c8dc74d9b839c..6d221fa7aa5437da755450de5514980f423750b6 100644 (file)
@@ -408,6 +408,20 @@ struct GTY((tag("GSS_EH_CTRL")))
   int region;
 };
 
+struct GTY((tag("GSS_EH_CTRL")))
+  gimple_statement_resx : public gimple_statement_eh_ctrl
+{
+  /* No extra fields; adds invariant:
+       stmt->code == GIMPLE_RESX.  */
+};
+
+struct GTY((tag("GSS_EH_CTRL")))
+  gimple_statement_eh_dispatch : public gimple_statement_eh_ctrl
+{
+  /* No extra fields; adds invariant:
+       stmt->code == GIMPLE_EH_DISPATH.  */
+};
+
 
 /* GIMPLE_TRY */
 
@@ -535,10 +549,9 @@ struct GTY((tag("GSS_OMP_FOR")))
 };
 
 
-/* GIMPLE_OMP_PARALLEL */
-
-struct GTY((tag("GSS_OMP_PARALLEL")))
-  gimple_statement_omp_parallel : public gimple_statement_omp
+/* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET */
+struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
+  gimple_statement_omp_parallel_layout : public gimple_statement_omp
 {
   /* [ WORD 1-7 ] : base class */
 
@@ -555,11 +568,35 @@ struct GTY((tag("GSS_OMP_PARALLEL")))
   tree data_arg;
 };
 
+/* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
+struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
+  gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_PARALLEL
+        || stmt->code == GIMPLE_OMP_TASK.  */
+};
+
+
+/* GIMPLE_OMP_PARALLEL */
+struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
+  gimple_statement_omp_parallel : public gimple_statement_omp_taskreg
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_PARALLEL.  */
+};
+
+struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
+  gimple_statement_omp_target : public gimple_statement_omp_parallel_layout
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_TARGET.  */
+};
 
 /* GIMPLE_OMP_TASK */
 
 struct GTY((tag("GSS_OMP_TASK")))
-  gimple_statement_omp_task : public gimple_statement_omp_parallel
+  gimple_statement_omp_task : public gimple_statement_omp_taskreg
 {
   /* [ WORD 1-10 ] : base class */
 
@@ -611,10 +648,10 @@ struct GTY((tag("GSS_OMP_CONTINUE")))
   tree control_use;
 };
 
-/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS */
+/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
 
-struct GTY((tag("GSS_OMP_SINGLE")))
-  gimple_statement_omp_single : public gimple_statement_omp
+struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
+  gimple_statement_omp_single_layout : public gimple_statement_omp
 {
   /* [ WORD 1-7 ] : base class */
 
@@ -622,6 +659,20 @@ struct GTY((tag("GSS_OMP_SINGLE")))
   tree clauses;
 };
 
+struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
+  gimple_statement_omp_single : public gimple_statement_omp_single_layout
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_SINGLE.  */
+};
+
+struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
+  gimple_statement_omp_teams : public gimple_statement_omp_single_layout
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_TEAMS.  */
+};
+
 
 /* GIMPLE_OMP_ATOMIC_LOAD.
    Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
@@ -639,8 +690,8 @@ struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
 /* GIMPLE_OMP_ATOMIC_STORE.
    See note on GIMPLE_OMP_ATOMIC_LOAD.  */
 
-struct GTY((tag("GSS_OMP_ATOMIC_STORE")))
-  gimple_statement_omp_atomic_store : public gimple_statement_base
+struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
+  gimple_statement_omp_atomic_store_layout : public gimple_statement_base
 {
   /* [ WORD 1-6 ] : base class */
 
@@ -648,6 +699,22 @@ struct GTY((tag("GSS_OMP_ATOMIC_STORE")))
   tree val;
 };
 
+struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
+  gimple_statement_omp_atomic_store :
+    public gimple_statement_omp_atomic_store_layout
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_ATOMIC_STORE.  */
+};
+
+struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
+  gimple_statement_omp_return :
+    public gimple_statement_omp_atomic_store_layout
+{
+    /* No extra fields; adds invariant:
+         stmt->code == GIMPLE_OMP_RETURN.  */
+};
+
 /* GIMPLE_TRANSACTION.  */
 
 /* Bits to be stored in the GIMPLE_TRANSACTION subcode.  */
@@ -730,9 +797,17 @@ is_a_helper <gimple_statement_catch>::test (gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <gimple_statement_eh_ctrl>::test (gimple gs)
+is_a_helper <gimple_statement_resx>::test (gimple gs)
+{
+  return gs->code == GIMPLE_RESX;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_eh_dispatch>::test (gimple gs)
 {
-  return gs->code == GIMPLE_RESX || gs->code == GIMPLE_EH_DISPATCH;
+  return gs->code == GIMPLE_EH_DISPATCH;
 }
 
 template <>
@@ -772,7 +847,15 @@ template <>
 inline bool
 is_a_helper <gimple_statement_omp_atomic_store>::test (gimple gs)
 {
-  return gs->code == GIMPLE_OMP_ATOMIC_STORE || gs->code == GIMPLE_OMP_RETURN;
+  return gs->code == GIMPLE_OMP_ATOMIC_STORE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_return>::test (gimple gs)
+{
+  return gs->code == GIMPLE_OMP_RETURN;
 }
 
 template <>
@@ -799,12 +882,28 @@ is_a_helper <gimple_statement_omp_for>::test (gimple gs)
   return gs->code == GIMPLE_OMP_FOR;
 }
 
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_taskreg>::test (gimple gs)
+{
+  return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK;
+}
+
 template <>
 template <>
 inline bool
 is_a_helper <gimple_statement_omp_parallel>::test (gimple gs)
 {
-  return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK || gs->code == GIMPLE_OMP_TARGET;
+  return gs->code == GIMPLE_OMP_PARALLEL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_target>::test (gimple gs)
+{
+  return gs->code == GIMPLE_OMP_TARGET;
 }
 
 template <>
@@ -820,7 +919,15 @@ template <>
 inline bool
 is_a_helper <gimple_statement_omp_single>::test (gimple gs)
 {
-  return gs->code == GIMPLE_OMP_SINGLE || gs->code == GIMPLE_OMP_TEAMS;
+  return gs->code == GIMPLE_OMP_SINGLE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_teams>::test (gimple gs)
+{
+  return gs->code == GIMPLE_OMP_TEAMS;
 }
 
 template <>
@@ -898,9 +1005,17 @@ is_a_helper <const gimple_statement_catch>::test (const_gimple gs)
 template <>
 template <>
 inline bool
-is_a_helper <const gimple_statement_eh_ctrl>::test (const_gimple gs)
+is_a_helper <const gimple_statement_resx>::test (const_gimple gs)
 {
-  return gs->code == GIMPLE_RESX || gs->code == GIMPLE_EH_DISPATCH;
+  return gs->code == GIMPLE_RESX;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_eh_dispatch>::test (const_gimple gs)
+{
+  return gs->code == GIMPLE_EH_DISPATCH;
 }
 
 template <>
@@ -924,7 +1039,15 @@ template <>
 inline bool
 is_a_helper <const gimple_statement_omp_atomic_store>::test (const_gimple gs)
 {
-  return gs->code == GIMPLE_OMP_ATOMIC_STORE || gs->code == GIMPLE_OMP_RETURN;
+  return gs->code == GIMPLE_OMP_ATOMIC_STORE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_return>::test (const_gimple gs)
+{
+  return gs->code == GIMPLE_OMP_RETURN;
 }
 
 template <>
@@ -951,12 +1074,28 @@ is_a_helper <const gimple_statement_omp_for>::test (const_gimple gs)
   return gs->code == GIMPLE_OMP_FOR;
 }
 
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_taskreg>::test (const_gimple gs)
+{
+  return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK;
+}
+
 template <>
 template <>
 inline bool
 is_a_helper <const gimple_statement_omp_parallel>::test (const_gimple gs)
 {
-  return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK || gs->code == GIMPLE_OMP_TARGET;
+  return gs->code == GIMPLE_OMP_PARALLEL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_target>::test (const_gimple gs)
+{
+  return gs->code == GIMPLE_OMP_TARGET;
 }
 
 template <>
@@ -972,7 +1111,15 @@ template <>
 inline bool
 is_a_helper <const gimple_statement_omp_single>::test (const_gimple gs)
 {
-  return gs->code == GIMPLE_OMP_SINGLE || gs->code == GIMPLE_OMP_TEAMS;
+  return gs->code == GIMPLE_OMP_SINGLE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_teams>::test (const_gimple gs)
+{
+  return gs->code == GIMPLE_OMP_TEAMS;
 }
 
 template <>
@@ -1753,9 +1900,9 @@ gimple_omp_return_nowait_p (const_gimple g)
 static inline void
 gimple_omp_return_set_lhs (gimple g, tree lhs)
 {
-  gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
-    as_a <gimple_statement_omp_atomic_store> (g);
-  omp_atomic_store_stmt->val = lhs;
+  gimple_statement_omp_return *omp_return_stmt =
+    as_a <gimple_statement_omp_return> (g);
+  omp_return_stmt->val = lhs;
 }
 
 
@@ -1764,9 +1911,9 @@ gimple_omp_return_set_lhs (gimple g, tree lhs)
 static inline tree
 gimple_omp_return_lhs (const_gimple g)
 {
-  const gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
-    as_a <const gimple_statement_omp_atomic_store> (g);
-  return omp_atomic_store_stmt->val;
+  const gimple_statement_omp_return *omp_return_stmt =
+    as_a <const gimple_statement_omp_return> (g);
+  return omp_return_stmt->val;
 }
 
 
@@ -1775,9 +1922,9 @@ gimple_omp_return_lhs (const_gimple g)
 static inline tree *
 gimple_omp_return_lhs_ptr (gimple g)
 {
-  gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
-    as_a <gimple_statement_omp_atomic_store> (g);
-  return &omp_atomic_store_stmt->val;
+  gimple_statement_omp_return *omp_return_stmt =
+    as_a <gimple_statement_omp_return> (g);
+  return &omp_return_stmt->val;
 }
 
 
@@ -3780,9 +3927,9 @@ gimple_phi_arg_has_location (gimple gs, size_t i)
 static inline int
 gimple_resx_region (const_gimple gs)
 {
-  const gimple_statement_eh_ctrl *eh_ctrl_stmt =
-    as_a <const gimple_statement_eh_ctrl> (gs);
-  return eh_ctrl_stmt->region;
+  const gimple_statement_resx *resx_stmt =
+    as_a <const gimple_statement_resx> (gs);
+  return resx_stmt->region;
 }
 
 /* Set REGION to be the region number for GIMPLE_RESX GS.  */
@@ -3790,9 +3937,8 @@ gimple_resx_region (const_gimple gs)
 static inline void
 gimple_resx_set_region (gimple gs, int region)
 {
-  gimple_statement_eh_ctrl *eh_ctrl_stmt =
-    as_a <gimple_statement_eh_ctrl> (gs);
-  eh_ctrl_stmt->region = region;
+  gimple_statement_resx *resx_stmt = as_a <gimple_statement_resx> (gs);
+  resx_stmt->region = region;
 }
 
 /* Return the region number for GIMPLE_EH_DISPATCH GS.  */
@@ -3800,9 +3946,9 @@ gimple_resx_set_region (gimple gs, int region)
 static inline int
 gimple_eh_dispatch_region (const_gimple gs)
 {
-  const gimple_statement_eh_ctrl *eh_ctrl_stmt =
-    as_a <const gimple_statement_eh_ctrl> (gs);
-  return eh_ctrl_stmt->region;
+  const gimple_statement_eh_dispatch *eh_dispatch_stmt =
+    as_a <const gimple_statement_eh_dispatch> (gs);
+  return eh_dispatch_stmt->region;
 }
 
 /* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS.  */
@@ -3810,9 +3956,9 @@ gimple_eh_dispatch_region (const_gimple gs)
 static inline void
 gimple_eh_dispatch_set_region (gimple gs, int region)
 {
-  gimple_statement_eh_ctrl *eh_ctrl_stmt =
-    as_a <gimple_statement_eh_ctrl> (gs);
-  eh_ctrl_stmt->region = region;
+  gimple_statement_eh_dispatch *eh_dispatch_stmt =
+    as_a <gimple_statement_eh_dispatch> (gs);
+  eh_dispatch_stmt->region = region;
 }
 
 /* Return the number of labels associated with the switch statement GS.  */
@@ -4650,9 +4796,9 @@ gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
 static inline tree
 gimple_omp_taskreg_clauses (const_gimple gs)
 {
-  const gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <const gimple_statement_omp_parallel> (gs);
-  return omp_parallel_stmt->clauses;
+  const gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <const gimple_statement_omp_taskreg> (gs);
+  return omp_taskreg_stmt->clauses;
 }
 
 
@@ -4661,9 +4807,9 @@ gimple_omp_taskreg_clauses (const_gimple gs)
 static inline tree *
 gimple_omp_taskreg_clauses_ptr (gimple gs)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  return &omp_parallel_stmt->clauses;
+  gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <gimple_statement_omp_taskreg> (gs);
+  return &omp_taskreg_stmt->clauses;
 }
 
 
@@ -4673,9 +4819,9 @@ gimple_omp_taskreg_clauses_ptr (gimple gs)
 static inline void
 gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  omp_parallel_stmt->clauses = clauses;
+  gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <gimple_statement_omp_taskreg> (gs);
+  omp_taskreg_stmt->clauses = clauses;
 }
 
 
@@ -4684,9 +4830,9 @@ gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
 static inline tree
 gimple_omp_taskreg_child_fn (const_gimple gs)
 {
-  const gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <const gimple_statement_omp_parallel> (gs);
-  return omp_parallel_stmt->child_fn;
+  const gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <const gimple_statement_omp_taskreg> (gs);
+  return omp_taskreg_stmt->child_fn;
 }
 
 /* Return a pointer to the child function used to hold the body of
@@ -4695,9 +4841,9 @@ gimple_omp_taskreg_child_fn (const_gimple gs)
 static inline tree *
 gimple_omp_taskreg_child_fn_ptr (gimple gs)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  return &omp_parallel_stmt->child_fn;
+  gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <gimple_statement_omp_taskreg> (gs);
+  return &omp_taskreg_stmt->child_fn;
 }
 
 
@@ -4706,9 +4852,9 @@ gimple_omp_taskreg_child_fn_ptr (gimple gs)
 static inline void
 gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  omp_parallel_stmt->child_fn = child_fn;
+  gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <gimple_statement_omp_taskreg> (gs);
+  omp_taskreg_stmt->child_fn = child_fn;
 }
 
 
@@ -4718,9 +4864,9 @@ gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
 static inline tree
 gimple_omp_taskreg_data_arg (const_gimple gs)
 {
-  const gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <const gimple_statement_omp_parallel> (gs);
-  return omp_parallel_stmt->data_arg;
+  const gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <const gimple_statement_omp_taskreg> (gs);
+  return omp_taskreg_stmt->data_arg;
 }
 
 
@@ -4729,9 +4875,9 @@ gimple_omp_taskreg_data_arg (const_gimple gs)
 static inline tree *
 gimple_omp_taskreg_data_arg_ptr (gimple gs)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  return &omp_parallel_stmt->data_arg;
+  gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <gimple_statement_omp_taskreg> (gs);
+  return &omp_taskreg_stmt->data_arg;
 }
 
 
@@ -4740,9 +4886,9 @@ gimple_omp_taskreg_data_arg_ptr (gimple gs)
 static inline void
 gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  omp_parallel_stmt->data_arg = data_arg;
+  gimple_statement_omp_taskreg *omp_taskreg_stmt =
+    as_a <gimple_statement_omp_taskreg> (gs);
+  omp_taskreg_stmt->data_arg = data_arg;
 }
 
 
@@ -4883,9 +5029,9 @@ gimple_omp_single_set_clauses (gimple gs, tree clauses)
 static inline tree
 gimple_omp_target_clauses (const_gimple gs)
 {
-  const gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <const gimple_statement_omp_parallel> (gs);
-  return omp_parallel_stmt->clauses;
+  const gimple_statement_omp_target *omp_target_stmt =
+    as_a <const gimple_statement_omp_target> (gs);
+  return omp_target_stmt->clauses;
 }
 
 
@@ -4894,9 +5040,9 @@ gimple_omp_target_clauses (const_gimple gs)
 static inline tree *
 gimple_omp_target_clauses_ptr (gimple gs)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  return &omp_parallel_stmt->clauses;
+  gimple_statement_omp_target *omp_target_stmt =
+    as_a <gimple_statement_omp_target> (gs);
+  return &omp_target_stmt->clauses;
 }
 
 
@@ -4905,9 +5051,9 @@ gimple_omp_target_clauses_ptr (gimple gs)
 static inline void
 gimple_omp_target_set_clauses (gimple gs, tree clauses)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  omp_parallel_stmt->clauses = clauses;
+  gimple_statement_omp_target *omp_target_stmt =
+    as_a <gimple_statement_omp_target> (gs);
+  omp_target_stmt->clauses = clauses;
 }
 
 
@@ -4937,9 +5083,9 @@ gimple_omp_target_set_kind (gimple g, int kind)
 static inline tree
 gimple_omp_target_child_fn (const_gimple gs)
 {
-  const gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <const gimple_statement_omp_parallel> (gs);
-  return omp_parallel_stmt->child_fn;
+  const gimple_statement_omp_target *omp_target_stmt =
+    as_a <const gimple_statement_omp_target> (gs);
+  return omp_target_stmt->child_fn;
 }
 
 /* Return a pointer to the child function used to hold the body of
@@ -4948,9 +5094,9 @@ gimple_omp_target_child_fn (const_gimple gs)
 static inline tree *
 gimple_omp_target_child_fn_ptr (gimple gs)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  return &omp_parallel_stmt->child_fn;
+  gimple_statement_omp_target *omp_target_stmt =
+    as_a <gimple_statement_omp_target> (gs);
+  return &omp_target_stmt->child_fn;
 }
 
 
@@ -4959,9 +5105,9 @@ gimple_omp_target_child_fn_ptr (gimple gs)
 static inline void
 gimple_omp_target_set_child_fn (gimple gs, tree child_fn)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  omp_parallel_stmt->child_fn = child_fn;
+  gimple_statement_omp_target *omp_target_stmt =
+    as_a <gimple_statement_omp_target> (gs);
+  omp_target_stmt->child_fn = child_fn;
 }
 
 
@@ -4971,9 +5117,9 @@ gimple_omp_target_set_child_fn (gimple gs, tree child_fn)
 static inline tree
 gimple_omp_target_data_arg (const_gimple gs)
 {
-  const gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <const gimple_statement_omp_parallel> (gs);
-  return omp_parallel_stmt->data_arg;
+  const gimple_statement_omp_target *omp_target_stmt =
+    as_a <const gimple_statement_omp_target> (gs);
+  return omp_target_stmt->data_arg;
 }
 
 
@@ -4982,9 +5128,9 @@ gimple_omp_target_data_arg (const_gimple gs)
 static inline tree *
 gimple_omp_target_data_arg_ptr (gimple gs)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  return &omp_parallel_stmt->data_arg;
+  gimple_statement_omp_target *omp_target_stmt =
+    as_a <gimple_statement_omp_target> (gs);
+  return &omp_target_stmt->data_arg;
 }
 
 
@@ -4993,9 +5139,9 @@ gimple_omp_target_data_arg_ptr (gimple gs)
 static inline void
 gimple_omp_target_set_data_arg (gimple gs, tree data_arg)
 {
-  gimple_statement_omp_parallel *omp_parallel_stmt =
-    as_a <gimple_statement_omp_parallel> (gs);
-  omp_parallel_stmt->data_arg = data_arg;
+  gimple_statement_omp_target *omp_target_stmt =
+    as_a <gimple_statement_omp_target> (gs);
+  omp_target_stmt->data_arg = data_arg;
 }
 
 
@@ -5004,9 +5150,9 @@ gimple_omp_target_set_data_arg (gimple gs, tree data_arg)
 static inline tree
 gimple_omp_teams_clauses (const_gimple gs)
 {
-  const gimple_statement_omp_single *omp_single_stmt =
-    as_a <const gimple_statement_omp_single> (gs);
-  return omp_single_stmt->clauses;
+  const gimple_statement_omp_teams *omp_teams_stmt =
+    as_a <const gimple_statement_omp_teams> (gs);
+  return omp_teams_stmt->clauses;
 }
 
 
@@ -5015,9 +5161,9 @@ gimple_omp_teams_clauses (const_gimple gs)
 static inline tree *
 gimple_omp_teams_clauses_ptr (gimple gs)
 {
-  gimple_statement_omp_single *omp_single_stmt =
-    as_a <gimple_statement_omp_single> (gs);
-  return &omp_single_stmt->clauses;
+  gimple_statement_omp_teams *omp_teams_stmt =
+    as_a <gimple_statement_omp_teams> (gs);
+  return &omp_teams_stmt->clauses;
 }
 
 
@@ -5026,9 +5172,9 @@ gimple_omp_teams_clauses_ptr (gimple gs)
 static inline void
 gimple_omp_teams_set_clauses (gimple gs, tree clauses)
 {
-  gimple_statement_omp_single *omp_single_stmt =
-    as_a <gimple_statement_omp_single> (gs);
-  omp_single_stmt->clauses = clauses;
+  gimple_statement_omp_teams *omp_teams_stmt =
+    as_a <gimple_statement_omp_teams> (gs);
+  omp_teams_stmt->clauses = clauses;
 }
 
 
index 91738f4095007bc9c7c96ed5a7361937f4207dd3..82f1f52a6f53b78427a5f0969d596bc59e984f8b 100644 (file)
@@ -43,11 +43,11 @@ DEFGSSTRUCT(GSS_WCE, gimple_statement_wce, false)
 DEFGSSTRUCT(GSS_OMP, gimple_statement_omp, false)
 DEFGSSTRUCT(GSS_OMP_CRITICAL, gimple_statement_omp_critical, false)
 DEFGSSTRUCT(GSS_OMP_FOR, gimple_statement_omp_for, false)
-DEFGSSTRUCT(GSS_OMP_PARALLEL, gimple_statement_omp_parallel, false)
+DEFGSSTRUCT(GSS_OMP_PARALLEL_LAYOUT, gimple_statement_omp_parallel_layout, false)
 DEFGSSTRUCT(GSS_OMP_TASK, gimple_statement_omp_task, false)
 DEFGSSTRUCT(GSS_OMP_SECTIONS, gimple_statement_omp_sections, false)
-DEFGSSTRUCT(GSS_OMP_SINGLE, gimple_statement_omp_single, false)
+DEFGSSTRUCT(GSS_OMP_SINGLE_LAYOUT, gimple_statement_omp_single_layout, false)
 DEFGSSTRUCT(GSS_OMP_CONTINUE, gimple_statement_omp_continue, false)
 DEFGSSTRUCT(GSS_OMP_ATOMIC_LOAD, gimple_statement_omp_atomic_load, false)
-DEFGSSTRUCT(GSS_OMP_ATOMIC_STORE, gimple_statement_omp_atomic_store, false)
+DEFGSSTRUCT(GSS_OMP_ATOMIC_STORE_LAYOUT, gimple_statement_omp_atomic_store, false)
 DEFGSSTRUCT(GSS_TRANSACTION, gimple_statement_transaction, false)