aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2012-05-03 14:34:07 +0000
committerMichael Matz <matz@gcc.gnu.org>2012-05-03 14:34:07 +0000
commit3e8b732e26584184ee273b8bab8fc924681c770b (patch)
treed681839cfc46539f6a7285ab0aee7f6206b1d145
parent1fa2969ff66462973c073f4605d8881e40551aff (diff)
downloadgcc-3e8b732e26584184ee273b8bab8fc924681c770b.zip
gcc-3e8b732e26584184ee273b8bab8fc924681c770b.tar.gz
gcc-3e8b732e26584184ee273b8bab8fc924681c770b.tar.bz2
basic-block.h (struct rtl_bb_info, [...]): Move in front of basic_block_def.
* basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move in front of basic_block_def. (struct basic_block_def): Make il.gimple the full struct, not a pointer. (__assert_gimple_bb_smaller_rtl_bb): Asserting typedef. * cfgexpand.c (expand_gimple_basic_block): Clear all il.gimple members. * gimple-iterator.c (gimple_stmt_iterator): Don't special case NULL il.gimple, which can't happen anymore. * gimple.h (bb_seq): il.gimple can't be NULL. (bb_seq_add): Ditto. (set_bb_seq): Adjust. (gsi_start_bb, gsi_last_bb): Tidy. * lto-streamer-in.c (make_new_block): Don't zero members that are zeroed already, don't allocate a gimple_bb_info. * tree-cfg.c (create_bb): Don't allocate a gimple_bb_info. (remove_bb): Clear all il.gimple members. (gimple_verify_flow_info): Adjust for flat il.gimple. * tree-flow-inline.h (phi_nodes, phi_nodes_ptr, set_phi_nodes): Adjust. * coretypes.h (const_gimple_seq): Remove typedef. * gimple.h (gimple_seq_first): Take gimple_seq. (gimple_seq_first_stmt): Ditto. (gimple_seq_last): Ditto. (gimple_seq_last_stmt): Ditto. (gimple_seq_empty_p): Ditto. From-SVN: r187099
-rw-r--r--gcc/ChangeLog30
-rw-r--r--gcc/basic-block.h52
-rw-r--r--gcc/cfgexpand.c3
-rw-r--r--gcc/coretypes.h1
-rw-r--r--gcc/gimple-iterator.c3
-rw-r--r--gcc/gimple.h52
-rw-r--r--gcc/lto-streamer-in.c3
-rw-r--r--gcc/tree-cfg.c8
-rw-r--r--gcc/tree-flow-inline.h12
9 files changed, 84 insertions, 80 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7b523a6..8f3228d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,33 @@
+2012-05-03 Michael Matz <matz@suse.de>
+
+ * basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move
+ in front of basic_block_def.
+ (struct basic_block_def): Make il.gimple the full struct, not a
+ pointer.
+ (__assert_gimple_bb_smaller_rtl_bb): Asserting typedef.
+
+ * cfgexpand.c (expand_gimple_basic_block): Clear all il.gimple
+ members.
+ * gimple-iterator.c (gimple_stmt_iterator): Don't special case
+ NULL il.gimple, which can't happen anymore.
+ * gimple.h (bb_seq): il.gimple can't be NULL.
+ (bb_seq_add): Ditto.
+ (set_bb_seq): Adjust.
+ (gsi_start_bb, gsi_last_bb): Tidy.
+ * lto-streamer-in.c (make_new_block): Don't zero members that
+ are zeroed already, don't allocate a gimple_bb_info.
+ * tree-cfg.c (create_bb): Don't allocate a gimple_bb_info.
+ (remove_bb): Clear all il.gimple members.
+ (gimple_verify_flow_info): Adjust for flat il.gimple.
+ * tree-flow-inline.h (phi_nodes, phi_nodes_ptr, set_phi_nodes): Adjust.
+
+ * coretypes.h (const_gimple_seq): Remove typedef.
+ * gimple.h (gimple_seq_first): Take gimple_seq.
+ (gimple_seq_first_stmt): Ditto.
+ (gimple_seq_last): Ditto.
+ (gimple_seq_last_stmt): Ditto.
+ (gimple_seq_empty_p): Ditto.
+
2012-05-03 Richard Guenther <rguenther@suse.de>
* tree-ssa-pre.c (valid_in_sets): Remove checking of trapping
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index f8cdea0..99df4d8 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -101,8 +101,27 @@ extern const struct gcov_ctr_summary *profile_info;
/* Declared in cfgloop.h. */
struct loop;
-/* Declared in tree-flow.h. */
-struct rtl_bb_info;
+struct GTY(()) rtl_bb_info {
+ /* The first and last insns of the block. */
+ rtx head_;
+ rtx end_;
+
+ /* In CFGlayout mode points to insn notes/jumptables to be placed just before
+ and after the block. */
+ rtx header;
+ rtx footer;
+
+ /* This field is used by the bb-reorder pass. */
+ int visited;
+};
+
+struct GTY(()) gimple_bb_info {
+ /* Sequence of statements in this block. */
+ gimple_seq seq;
+
+ /* PHI nodes for this block. */
+ gimple_seq phi_nodes;
+};
/* A basic block is a sequence of instructions with only entry and
only one exit. If any one of the instructions are executed, they
@@ -149,7 +168,7 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d
struct basic_block_def *next_bb;
union basic_block_il_dependent {
- struct gimple_bb_info * GTY ((tag ("0"))) gimple;
+ struct gimple_bb_info GTY ((tag ("0"))) gimple;
struct rtl_bb_info * GTY ((tag ("1"))) rtl;
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
@@ -172,27 +191,12 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d
int flags;
};
-struct GTY(()) rtl_bb_info {
- /* The first and last insns of the block. */
- rtx head_;
- rtx end_;
-
- /* In CFGlayout mode points to insn notes/jumptables to be placed just before
- and after the block. */
- rtx header;
- rtx footer;
-
- /* This field is used by the bb-reorder and tracer passes. */
- int visited;
-};
-
-struct GTY(()) gimple_bb_info {
- /* Sequence of statements in this block. */
- gimple_seq seq;
-
- /* PHI nodes for this block. */
- gimple_seq phi_nodes;
-};
+/* This ensures that struct gimple_bb_info is smaller than
+ struct rtl_bb_info, so that inlining the former into basic_block_def
+ is the better choice. */
+typedef int __assert_gimple_bb_smaller_rtl_bb
+ [(int)sizeof(struct rtl_bb_info)
+ - (int)sizeof (struct gimple_bb_info)];
DEF_VEC_P(basic_block);
DEF_VEC_ALLOC_P(basic_block,gc);
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 4c27e76..81392b6 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3730,7 +3730,8 @@ expand_gimple_basic_block (basic_block bb)
block to be in GIMPLE, instead of RTL. Therefore, we need to
access the BB sequence directly. */
stmts = bb_seq (bb);
- bb->il.gimple = NULL;
+ bb->il.gimple.seq = NULL;
+ bb->il.gimple.phi_nodes = NULL;
rtl_profile_for_bb (bb);
init_rtl_bb_info (bb);
bb->flags |= BB_RTL;
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 813b0c3..7e5c048 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -73,7 +73,6 @@ struct cl_option_handlers;
struct diagnostic_context;
typedef struct diagnostic_context diagnostic_context;
typedef gimple gimple_seq;
-typedef gimple const_gimple_seq;
/* Address space number for named address space support. */
typedef unsigned char addr_space_t;
diff --git a/gcc/gimple-iterator.c b/gcc/gimple-iterator.c
index dd78faa..0f1d497 100644
--- a/gcc/gimple-iterator.c
+++ b/gcc/gimple-iterator.c
@@ -865,6 +865,5 @@ gimple_stmt_iterator
gsi_start_phis (basic_block bb)
{
gimple_seq *pseq = phi_nodes_ptr (bb);
- /* XXX check only necessary because ENTRY/EXIT blocks don't have il.gimple */
- return pseq ? gsi_start_1 (pseq) : gsi_none ();
+ return gsi_start_1 (pseq);
}
diff --git a/gcc/gimple.h b/gcc/gimple.h
index c40d7c3..80271a1 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1023,7 +1023,7 @@ extern bool types_compatible_p (tree, tree);
/* Return the first node in GIMPLE sequence S. */
static inline gimple_seq_node
-gimple_seq_first (const_gimple_seq s)
+gimple_seq_first (gimple_seq s)
{
return s;
}
@@ -1032,7 +1032,7 @@ gimple_seq_first (const_gimple_seq s)
/* Return the first statement in GIMPLE sequence S. */
static inline gimple
-gimple_seq_first_stmt (const_gimple_seq s)
+gimple_seq_first_stmt (gimple_seq s)
{
gimple_seq_node n = gimple_seq_first (s);
return n;
@@ -1042,7 +1042,7 @@ gimple_seq_first_stmt (const_gimple_seq s)
/* Return the last node in GIMPLE sequence S. */
static inline gimple_seq_node
-gimple_seq_last (const_gimple_seq s)
+gimple_seq_last (gimple_seq s)
{
return s ? s->gsbase.prev : NULL;
}
@@ -1051,7 +1051,7 @@ gimple_seq_last (const_gimple_seq s)
/* Return the last statement in GIMPLE sequence S. */
static inline gimple
-gimple_seq_last_stmt (const_gimple_seq s)
+gimple_seq_last_stmt (gimple_seq s)
{
gimple_seq_node n = gimple_seq_last (s);
return n;
@@ -1079,7 +1079,7 @@ gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
/* Return true if GIMPLE sequence S is empty. */
static inline bool
-gimple_seq_empty_p (const_gimple_seq s)
+gimple_seq_empty_p (gimple_seq s)
{
return s == NULL;
}
@@ -1110,13 +1110,13 @@ gimple_seq_alloc_with_stmt (gimple stmt)
static inline gimple_seq
bb_seq (const_basic_block bb)
{
- return (!(bb->flags & BB_RTL) && bb->il.gimple) ? bb->il.gimple->seq : NULL;
+ return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
}
static inline gimple_seq *
-bb_seq_addr (const_basic_block bb)
+bb_seq_addr (basic_block bb)
{
- return (!(bb->flags & BB_RTL) && bb->il.gimple) ? &bb->il.gimple->seq : NULL;
+ return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
}
/* Sets the sequence of statements in BB to SEQ. */
@@ -1125,7 +1125,7 @@ static inline void
set_bb_seq (basic_block bb, gimple_seq seq)
{
gcc_checking_assert (!(bb->flags & BB_RTL));
- bb->il.gimple->seq = seq;
+ bb->il.gimple.seq = seq;
}
@@ -4975,20 +4975,9 @@ gsi_start_bb (basic_block bb)
gimple_seq *seq;
seq = bb_seq_addr (bb);
- if (!seq)
- /* XXX Only necessary because of ENTRY/EXIT block which don't have
- il.gimple */
- {
- i.ptr = NULL;
- i.seq = NULL;
- i.bb = NULL;
- }
- else
- {
- i.ptr = gimple_seq_first (*seq);
- i.seq = seq;
- i.bb = bb;
- }
+ i.ptr = gimple_seq_first (*seq);
+ i.seq = seq;
+ i.bb = bb;
return i;
}
@@ -5019,20 +5008,9 @@ gsi_last_bb (basic_block bb)
gimple_seq *seq;
seq = bb_seq_addr (bb);
- if (!seq)
- /* XXX Only necessary because of ENTRY/EXIT block which don't have
- il.gimple */
- {
- i.ptr = NULL;
- i.seq = NULL;
- i.bb = NULL;
- }
- else
- {
- i.ptr = gimple_seq_last (*seq);
- i.seq = seq;
- i.bb = bb;
- }
+ i.ptr = gimple_seq_last (*seq);
+ i.seq = seq;
+ i.bb = bb;
return i;
}
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 394c3d7..5d61775 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -599,10 +599,7 @@ make_new_block (struct function *fn, unsigned int index)
basic_block bb = alloc_block ();
bb->index = index;
SET_BASIC_BLOCK_FOR_FUNCTION (fn, index, bb);
- bb->il.gimple = ggc_alloc_cleared_gimple_bb_info ();
n_basic_blocks_for_function (fn)++;
- bb->flags = 0;
- set_bb_seq (bb, NULL);
return bb;
}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 7d884c9..c9f02f3 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -438,7 +438,6 @@ create_bb (void *h, void *e, basic_block after)
bb->index = last_basic_block;
bb->flags = BB_NEW;
- bb->il.gimple = ggc_alloc_cleared_gimple_bb_info ();
set_bb_seq (bb, h ? (gimple_seq) h : NULL);
/* Add the new block to the linked list of blocks. */
@@ -1918,7 +1917,8 @@ remove_bb (basic_block bb)
}
remove_phi_nodes_and_edges_for_unreachable_block (bb);
- bb->il.gimple = NULL;
+ bb->il.gimple.seq = NULL;
+ bb->il.gimple.phi_nodes = NULL;
}
@@ -4614,13 +4614,13 @@ gimple_verify_flow_info (void)
edge e;
edge_iterator ei;
- if (ENTRY_BLOCK_PTR->il.gimple)
+ if (ENTRY_BLOCK_PTR->il.gimple.seq || ENTRY_BLOCK_PTR->il.gimple.phi_nodes)
{
error ("ENTRY_BLOCK has IL associated with it");
err = 1;
}
- if (EXIT_BLOCK_PTR->il.gimple)
+ if (EXIT_BLOCK_PTR->il.gimple.seq || EXIT_BLOCK_PTR->il.gimple.phi_nodes)
{
error ("EXIT_BLOCK has IL associated with it");
err = 1;
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 066e9ad..8627fc3 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -506,18 +506,14 @@ static inline gimple_seq
phi_nodes (const_basic_block bb)
{
gcc_checking_assert (!(bb->flags & BB_RTL));
- if (!bb->il.gimple)
- return NULL;
- return bb->il.gimple->phi_nodes;
+ return bb->il.gimple.phi_nodes;
}
static inline gimple_seq *
-phi_nodes_ptr (const_basic_block bb)
+phi_nodes_ptr (basic_block bb)
{
gcc_checking_assert (!(bb->flags & BB_RTL));
- if (!bb->il.gimple)
- return NULL;
- return &bb->il.gimple->phi_nodes;
+ return &bb->il.gimple.phi_nodes;
}
/* Set PHI nodes of a basic block BB to SEQ. */
@@ -528,7 +524,7 @@ set_phi_nodes (basic_block bb, gimple_seq seq)
gimple_stmt_iterator i;
gcc_checking_assert (!(bb->flags & BB_RTL));
- bb->il.gimple->phi_nodes = seq;
+ bb->il.gimple.phi_nodes = seq;
if (seq)
for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
gimple_set_bb (gsi_stmt (i), bb);