[tuples] warning patrol
Aldy Hernandez
aldyh@redhat.com
Fri Aug 24 21:55:00 GMT 2007
Boring cleanup patch 1 of 2^32.
The only thing remotely interesting is that I've removed phi_nodes_ptr.
Since phi nodes for a BB are now a sequence, we no longer need to pass
the pointer around. This reminds me that we need to rework
tree-phinodes.c.
Committed to branch.
* tree-phinodes.c (reserve_phi_args_for_new_edge): Comment out
call to phi_nodes_ptr.
(remove_phi_node): Same.
* tree-flow-inline.h (get_lineno): Work with empty statements or
empty locations.
(phi_nodes_ptr): Remove.
(phi_arg_index_from_use): Adjust for tuples.
(bsi_stmt_ptr): Add ATTRIBUTE_UNUSED.
(op_iter_init): Remove assertion.
(next_imm_use_stmt): Change NULL_TREE to NULL.
* tree-dfa.c (mark_symbols_for_renaming): Adjust for tuples.
* tree-flow.h: Remove bb_for_stmt prototype.
(mark_symbols_for_renaming): Make argument gimple.
Index: tree-phinodes.c
===================================================================
--- tree-phinodes.c (revision 127746)
+++ tree-phinodes.c (working copy)
@@ -312,7 +312,13 @@ reserve_phi_args_for_new_edge (basic_blo
int len = EDGE_COUNT (bb->preds);
int cap = ideal_phi_node_len (len + 4);
+ /* FIXME tuples: We no longer have phi_nodes_ptr. Must rewrite
+ this. */
+#if 0
for (loc = phi_nodes_ptr (bb);
+#else
+ for (loc = NULL;
+#endif
*loc;
loc = &PHI_CHAIN (*loc))
{
@@ -457,7 +463,13 @@ remove_phi_node (tree phi, tree prev, bo
}
else
{
+ /* FIXME tuples: We no longer have phi_nodes_ptr. Must rework
+ this. */
+#if 0
for (loc = phi_nodes_ptr (gimple_bb (phi));
+#else
+ for (loc = NULL;
+#endif
*loc != phi;
loc = &PHI_CHAIN (*loc))
;
Index: tree-flow-inline.h
===================================================================
--- tree-flow-inline.h (revision 127746)
+++ tree-flow-inline.h (working copy)
@@ -302,8 +302,14 @@ may_aliases (const_tree var)
static inline int
get_lineno (gimple stmt)
{
+ location_t loc;
+
if (!stmt)
- return;
+ return -1;
+
+ loc = gimple_locus (stmt);
+ if (loc.line == 0 && loc.file == 0)
+ return -1;
return gimple_locus (stmt).line;
}
@@ -631,15 +637,6 @@ phi_nodes (basic_block bb)
return bb->il.gimple->phi_nodes;
}
-/* Return pointer to the list of PHI nodes for basic block BB. */
-
-static inline tree *
-phi_nodes_ptr (basic_block bb)
-{
- gcc_assert (!(bb->flags & BB_RTL));
- return &bb->il.gimple->phi_nodes;
-}
-
/* Phi nodes of a basic block BB to L. */
static inline void
@@ -660,17 +657,17 @@ phi_arg_index_from_use (use_operand_p us
{
struct phi_arg_d *element, *root;
int index;
- tree phi;
+ gimple phi;
/* Since the use is the first thing in a PHI argument element, we can
calculate its index based on casting it to an argument, and performing
pointer arithmetic. */
phi = USE_STMT (use);
- gcc_assert (TREE_CODE (phi) == PHI_NODE);
+ gcc_assert (gimple_code (phi) == GIMPLE_PHI);
element = (struct phi_arg_d *)use;
- root = &(PHI_ARG_ELT (phi, 0));
+ root = gimple_phi_arg (phi, 0);
index = element - root;
#ifdef ENABLE_CHECKING
@@ -678,7 +675,7 @@ phi_arg_index_from_use (use_operand_p us
then imm_use is likely not the first element in phi_arg_d. */
gcc_assert (
(((char *)element - (char *)root) % sizeof (struct phi_arg_d)) == 0);
- gcc_assert (index >= 0 && index < PHI_ARG_CAPACITY (phi));
+ gcc_assert (index >= 0 && index < (int) gimple_phi_capacity (phi));
#endif
return index;
@@ -824,7 +821,7 @@ bsi_stmt (block_stmt_iterator i)
/* Return a pointer to the statement that block statement iterator I
is currently at. */
static inline tree *
-bsi_stmt_ptr (block_stmt_iterator i)
+bsi_stmt_ptr (block_stmt_iterator i ATTRIBUTE_UNUSED)
{
/* FIXME tuples!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
return tsi_stmt_ptr (i.tsi);
@@ -1085,10 +1082,6 @@ clear_and_done_ssa_iter (ssa_op_iter *pt
static inline void
op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (stmt_ann (stmt));
-#endif
-
ptr->defs = (flags & SSA_OP_DEF) ? DEF_OPS (stmt) : NULL;
ptr->uses = (flags & SSA_OP_USE) ? USE_OPS (stmt) : NULL;
ptr->vuses = (flags & SSA_OP_VUSE) ? VUSE_OPS (stmt) : NULL;
@@ -1515,7 +1508,7 @@ next_imm_use_stmt (imm_use_iterator *imm
{
if (imm->iter_node.prev != NULL)
delink_imm_use (&imm->iter_node);
- return NULL_TREE;
+ return NULL;
}
link_use_stmts_after (imm->imm_use, imm);
Index: tree-dfa.c
===================================================================
--- tree-dfa.c (revision 127694)
+++ tree-dfa.c (working copy)
@@ -823,7 +823,7 @@ get_virtual_var (tree var)
combination push_stmt_changes/pop_stmt_changes. */
void
-mark_symbols_for_renaming (tree stmt)
+mark_symbols_for_renaming (gimple stmt)
{
tree op;
ssa_op_iter iter;
Index: tree-flow.h
===================================================================
--- tree-flow.h (revision 127746)
+++ tree-flow.h (working copy)
@@ -528,7 +528,6 @@ static inline stmt_ann_t stmt_ann (tree)
static inline bool has_stmt_ann (tree);
static inline stmt_ann_t get_stmt_ann (tree);
static inline enum tree_ann_type ann_type (tree_ann_t);
-static inline basic_block bb_for_stmt (gimple);
extern void set_bb_for_stmt (gimple, basic_block);
static inline bool noreturn_call_p (gimple);
static inline void update_stmt (gimple);
@@ -807,7 +806,7 @@ extern void debug_subvars_for (tree);
extern tree get_virtual_var (tree);
extern void add_referenced_var (tree);
extern void remove_referenced_var (tree);
-extern void mark_symbols_for_renaming (tree);
+extern void mark_symbols_for_renaming (gimple);
extern void find_new_referenced_vars (tree *);
extern tree make_rename_temp (tree, const char *);
extern void set_default_def (tree, tree);
More information about the Gcc-patches
mailing list