aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-01-25 21:49:52 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-01-25 21:49:52 +0000
commit7821bfc741f6cdf7044997ce8a9e157920765c1a (patch)
tree16a8b8743826b7fb1be29a0f0f140d95a6a88de1 /gcc
parent5f0bea72c558bdd22238fffb4ba31d71221c473a (diff)
downloadgcc-7821bfc741f6cdf7044997ce8a9e157920765c1a.zip
gcc-7821bfc741f6cdf7044997ce8a9e157920765c1a.tar.gz
gcc-7821bfc741f6cdf7044997ce8a9e157920765c1a.tar.bz2
gcse.c (bypass_last_basic_block): New global variable.
* gcse.c (bypass_last_basic_block): New global variable. (bypass_block): Use redirect_edge_and_branch_force to redirect fall-through edges. Use bypass_last_basic_block to determine which blocks have valid PRE information. (bypass_conditional_jumps): Initialize bypass_last_basic_block. From-SVN: r61800
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gcse.c27
2 files changed, 30 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9c7c804..b34f957 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * gcse.c (bypass_last_basic_block): New global variable.
+ (bypass_block): Use redirect_edge_and_branch_force to redirect
+ fall-through edges. Use bypass_last_basic_block to determine
+ which blocks have valid PRE information.
+ (bypass_conditional_jumps): Initialize bypass_last_basic_block.
+
Sat Jan 25 22:31:59 CET 2003 Jan Hubicka <jh@suse.cz>
* gcse.c (local_cprop_pass): Update reg_sets table when needed.
diff --git a/gcc/gcse.c b/gcc/gcse.c
index cf724f4..a68374d 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -4527,6 +4527,13 @@ one_cprop_pass (pass, cprop_jumps, bypass_jumps)
/* Bypass conditional jumps. */
+/* The value of last_basic_block at the beginning of the jump_bypass
+ pass. The use of redirect_edge_and_branch_force may introduce new
+ basic blocks, but the data flow analysis is only valid for basic
+ block indices less than bypass_last_basic_block. */
+
+static int bypass_last_basic_block;
+
/* Find a set of REGNO to a constant that is available at the end of basic
block BB. Returns NULL if no such set is found. Based heavily upon
find_avail_set. */
@@ -4597,6 +4604,13 @@ bypass_block (bb, setcc, jump)
for (e = bb->pred; e; e = enext)
{
enext = e->pred_next;
+ if (e->flags & EDGE_COMPLEX)
+ continue;
+
+ /* We can't redirect edges from new basic blocks. */
+ if (e->src->index >= bypass_last_basic_block)
+ continue;
+
for (i = 0; i < reg_use_count; i++)
{
struct reg_use *reg_used = &reg_use_table[i];
@@ -4630,12 +4644,13 @@ bypass_block (bb, setcc, jump)
else
dest = NULL;
- /* Once basic block indices are stable, we should be able
- to use redirect_edge_and_branch_force instead. */
old_dest = e->dest;
- if (dest != NULL && dest != old_dest
- && redirect_edge_and_branch (e, dest))
- {
+ if (dest != NULL
+ && dest != old_dest
+ && dest != EXIT_BLOCK_PTR)
+ {
+ redirect_edge_and_branch_force (e, dest);
+
/* Copy the register setter to the redirected edge.
Don't copy CC0 setters, as CC0 is dead after jump. */
if (setcc)
@@ -4679,6 +4694,8 @@ bypass_conditional_jumps ()
if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR)
return 0;
+ bypass_last_basic_block = last_basic_block;
+
changed = 0;
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb->next_bb,
EXIT_BLOCK_PTR, next_bb)