summaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-17 17:47:47 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-17 17:47:47 +0000
commit3aaaf63fd1edbedcdd7c589ac28ac72328d71579 (patch)
tree4fcf2b4a4a942255116e20d36035b7def3cb2457 /gcc/tree-flow-inline.h
parent5366615540879f7f51b8350e9985e5a722d26983 (diff)
downloadgcc-3aaaf63fd1edbedcdd7c589ac28ac72328d71579.tar.gz
PR tree-optimization/15991
* tree-cfg.c (tree_block_label): Export. * tree-flow-inline.h (bsi_after_labels): New function. * tree-flow.h (bsi_after_labels, tree_block_label): Declare. * tree-ssa.c (propagate_into_addr): New function. (replace_immediate_uses): Handle propagation of pointer constants. (raise_value): Do not restrict propagation of pointer constants. * tree-ssanames.c (duplicate_ssa_name): New function. * tree.h (duplicate_ssa_name): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83297 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r--gcc/tree-flow-inline.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 4fe44ef112e..c47ba09c515 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -629,6 +629,53 @@ bsi_start (basic_block bb)
return bsi;
}
+/* Return a block statement iterator that points to the last label in
+ block BB. */
+
+static inline block_stmt_iterator
+bsi_after_labels (basic_block bb)
+{
+ block_stmt_iterator bsi;
+ tree_stmt_iterator next;
+
+ bsi.bb = bb;
+
+ if (!bb->stmt_list)
+ {
+#ifdef ENABLE_CHECKING
+ if (bb->index >= 0)
+ abort ();
+#endif
+ bsi.tsi.ptr = NULL;
+ bsi.tsi.container = NULL;
+ return bsi;
+ }
+
+ bsi.tsi = tsi_start (bb->stmt_list);
+ if (tsi_end_p (bsi.tsi))
+ return bsi;
+
+ /* Ensure that there are some labels. The rationale is that we want
+ to insert after the bsi that is returned, and these insertions should
+ be placed at the start of the basic block. This would not work if the
+ first statement was not label; rather fail here than enable the user
+ proceed in wrong way. */
+ if (TREE_CODE (tsi_stmt (bsi.tsi)) != LABEL_EXPR)
+ abort ();
+
+ next = bsi.tsi;
+ tsi_next (&next);
+
+ while (!tsi_end_p (next)
+ && TREE_CODE (tsi_stmt (next)) == LABEL_EXPR)
+ {
+ bsi.tsi = next;
+ tsi_next (&next);
+ }
+
+ return bsi;
+}
+
/* Return a block statement iterator that points to the end of basic
block BB. */
static inline block_stmt_iterator