public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Sub-blocks
@ 2012-11-16 15:07 Philip Herron
  0 siblings, 0 replies; only message in thread
From: Philip Herron @ 2012-11-16 15:07 UTC (permalink / raw)
  To: GCC

Hey guys

I've been having problems trying to create a sub block i keep getting the error:

<built-in>:0:0: internal compiler error: in gimplify_expr, at gimplify.c:7798

So far i have been playing with:

tree block_tree = make_node (BLOCK);
  tree pystmts = NULL_TREE;

  tree fndecl = current_function_decl;
  gcc_assert (fndecl != NULL_TREE);

append_to_statement_list (x, &pystmts)

 tree superblock_tree = DECL_INITIAL(fndecl);
  BLOCK_SUPERCONTEXT(block_tree) = superblock_tree;
  tree* pp;
  for (pp = &BLOCK_SUBBLOCKS(superblock_tree);
       *pp != NULL_TREE;
       pp = &BLOCK_CHAIN(*pp))
    ;
  *pp = block_tree;

  TREE_USED (block_tree) = 1;
  tree bind_tree = build3_loc (UNKNOWN_LOCATION, BIND_EXPR,
			       void_type_node, NULL_TREE,
			       NULL_TREE, block_tree);
  TREE_SIDE_EFFECTS(bind_tree) = 1;
  BIND_EXPR_BODY(bind_tree) = pystmts;
  pystmts = bind_tree;

popout of that suite then:

append_to_statement_list (bind_tree, &stmts)

I really don't understand BIND and BLOCKS i think, seems BLOCK contain
some statement list stuff and BIND brings that all together with
BLOCK_VARS and BIND_EXPR_BODY.

I have the block in between 2 labels which compile fine but when
trying to make this into a block i just really understand where iam
going wrong or what i am missing.

--Phil

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-16 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16 15:07 Sub-blocks Philip Herron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).