aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/bb-reorder.c13
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c7f9559..955e05f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2003-12-20 Josef Zlomek <zlomekj@suse.cz>
+
+ PR optimization/13430, PR optimization/12322
+ * bb-reorder.c (copy_bb_p): Do not allow block with many successors to
+ be copied.
+ (find_traces_1_round): Surround check for fake edges by
+ #ifdef ENABLE_CHECKING #endif.
+
2003-12-20 Eric Botcazou <ebotcazou@libertysurf.fr>
PR other/7956
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 85e184d..fc50b64 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -415,8 +415,10 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
/* Select the successor that will be placed after BB. */
for (e = bb->succ; e; e = e->succ_next)
{
+#ifdef ENABLE_CHECKING
if (e->flags & EDGE_FAKE)
abort ();
+#endif
if (e->dest == EXIT_BLOCK_PTR)
continue;
@@ -1001,6 +1003,8 @@ copy_bb_p (basic_block bb, int code_may_grow)
int size = 0;
int max_size = uncond_jump_length;
rtx insn;
+ int n_succ;
+ edge e;
if (!bb->frequency)
return false;
@@ -1009,6 +1013,15 @@ copy_bb_p (basic_block bb, int code_may_grow)
if (!cfg_layout_can_duplicate_bb_p (bb))
return false;
+ /* Avoid duplicating blocks which have many successors (PR/13430). */
+ n_succ = 0;
+ for (e = bb->succ; e; e = e->succ_next)
+ {
+ n_succ++;
+ if (n_succ > 8)
+ return false;
+ }
+
if (code_may_grow && maybe_hot_bb_p (bb))
max_size *= 8;