This is the mail archive of the mailing list for the GCC project.

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

Re: [tuples] gimple-tuples-branch created

On 9/18/06, Aldy Hernandez <> wrote:
> You can make a GIMPLE_STATEMENT_LIST tree with only the struct
> gimple_stmt * member, and make the gimplifier create those, and change
> the small amount of code that knows about them to use it.

I talked it over with Diego and he thought this would be a better or less
invasive approach (FLW).

Let me see if we're on the same page.  Are you suggesting having a
GIMPLE_STATEMENT_LIST in addition to STATEMENT_LIST, like my header changes
below ??

If so, we would also need to:

- Handle GIMPLE_STATEMENT_LIST any place we currently handle STATEMENT_LIST.

- Change all append_to_statement_list to append_to_gimple_statement_list and alloc_stmt_list to alloc_gimple_stmt_list.

- Change all tree_stmt_iterator code to corresponding gimple_stmt_iterator code.

Is this what you had in mind? If so, I don't see this being a "small amount of code" (not that I'm complaining, just saying...).

Let me rephrase. The amount of code that knows how to deal with STATEMENT_LIST is small compared to the amount of code that knows how to deal with every other class of tree.

It's relatively well abstracted so that almost all uses are in
gimplify.c, tree-cfg.c, and tree-iterator.c

Index: tree.h
--- tree.h      (revision 116725)
+++ tree.h      (working copy)
@@ -3157,7 +3157,7 @@ struct tree_type_decl GTY(())


-/* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
+/* A STATEMENT_LIST chains statements together in GENERIC.
    To reduce overhead, the nodes containing the statements are not trees.
    This avoids the overhead of tree_common on all linked list elements.

@@ -3184,6 +3184,25 @@ struct tree_statement_list
   struct tree_statement_list_node *tail;

+   statements.  */
+struct gimple_statement_list_node
+  GTY ((chain_next (""), chain_prev ("%h.prev")))
+  struct gimple_statement_list_node *prev;
+  struct gimple_statement_list_node *next;
+  struct gimple_stmt gs;

Should be *gs, i think.

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