diff options
author | Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> | 2004-06-17 19:47:47 +0200 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2004-06-17 17:47:47 +0000 |
commit | d7621d3c741403a604eab08b66658d71f3452e8d (patch) | |
tree | 4fcf2b4a4a942255116e20d36035b7def3cb2457 /gcc/tree-flow-inline.h | |
parent | f2b5cf977e5f5cce0434b890cc184872bcf1d5bc (diff) | |
download | gcc-d7621d3c741403a604eab08b66658d71f3452e8d.zip gcc-d7621d3c741403a604eab08b66658d71f3452e8d.tar.gz gcc-d7621d3c741403a604eab08b66658d71f3452e8d.tar.bz2 |
re PR tree-optimization/15991 (phi nodes with identical arguments still remain at t50.tailc)
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.
From-SVN: r83297
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r-- | gcc/tree-flow-inline.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 4fe44ef..c47ba09 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 |