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


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

Re: [tuples] gimple-tuples-branch created


> One more thing I forgot... we need to rewrite STATEMENT_LIST's into
> GIMPLE_STATEMENT_LIST's in the gimplifier so subsequent passes only have
> to deal with gimple statement lists.

More snafus along the way...

As discussed on irc, currently we have a mixture of trees and gimple
statements at the end of gimplification because we only have
GIMPLE_MODIFY_STMT's implemented.  Eventually we'll have all GIMPLE_*_STMT's
implemented and post gimplification we'll *only* have gimple tuples as
statements.

So for now, let's have gimple_statement_list_node include both gimple stmt's
and trees:

	struct gimple_statement_list_node
	  GTY ((chain_next ("%h.next"), chain_prev ("%h.prev")))
	{
	  struct gimple_statement_list_node *prev;
	  struct gimple_statement_list_node *next;
	  struct gimple_stmt *gimple_stmt;
	  tree stmt;
	};

Then we can kludge tsi_stmt_ptr() (or in this case gsi_stmt_ptr()) to
return either gimple_stmt or stmt depending on what the node contains.

Something like:

	static inline tree *
	gsi_stmt_ptr (tree_stmt_iterator i)
	{
	  if (i.ptr->stmt != NULL_TREE)
	    return &i.ptr->stmt;
	  else if (i.ptr->gimple_stmt != NULL_TREE)
	    return &GIMPLE_STMT_TO_TREE (i.ptr->gimple_stmt);
	  else
	    gcc_unreachable ();
	}

Notice we have to return a "tree *" anyhow, because the callers of ?si_stmt_ptr
are expecting a tree.

Agreed?

Aldy


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