summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-20 12:39:01 +0000
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-20 12:39:01 +0000
commitecb643e2bf1e606e695ebb295942c0c68d61caaa (patch)
tree6152adf70398cd3ab6b4380c422bc304208173a0 /gcc
parent6ce9e1982e4ce20b987562d4a4d9b3fcfe576225 (diff)
downloadgcc-ecb643e2bf1e606e695ebb295942c0c68d61caaa.tar.gz
(merge_blocks_move_predecessor_nojumps): Re-order the basic
block records so that merge_blocks_nomove will clean up correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30100 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/flow.c16
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9a7fd9484a2..de82cea9293 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -2,6 +2,9 @@ Wed Oct 20 10:46:41 1999 Richard Earnshaw (rearnsha@arm.com)
* jump.c (jump_optimize_1): More accurately detect casesi insns.
+ * flow.c (merge_blocks_move_predecessor_nojumps): Re-order the basic
+ block records so that merge_blocks_nomove will clean up correctly.
+
Tue Oct 19 23:43:50 1999 Jeffrey A Law (law@cygnus.com)
* pa.md (call, call_value): Do not emit a blockage after restoring
diff --git a/gcc/flow.c b/gcc/flow.c
index aaa006ae104..fcefe0aaa2c 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -2006,6 +2006,7 @@ merge_blocks_move_predecessor_nojumps (a, b)
basic_block a, b;
{
rtx start, end, insertpoint, barrier;
+ int index;
start = a->head;
end = a->end;
@@ -2037,15 +2038,24 @@ merge_blocks_move_predecessor_nojumps (a, b)
/* Scramble the insn chain. */
reorder_insns (start, end, insertpoint);
- /* Now blocks A and B are contiguous. Merge them. */
- merge_blocks_nomove (a, b);
-
if (rtl_dump_file)
{
fprintf (rtl_dump_file, "Moved block %d before %d and merged.\n",
a->index, b->index);
}
+ /* Swap the records for the two blocks around. Although we are deleting B,
+ A is now where B was and we want to compact the BB array from where
+ A used to be. */
+ BASIC_BLOCK(a->index) = b;
+ BASIC_BLOCK(b->index) = a;
+ index = a->index;
+ a->index = b->index;
+ b->index = index;
+
+ /* Now blocks A and B are contiguous. Merge them. */
+ merge_blocks_nomove (a, b);
+
return 1;
}