gcse.c (bypass_block): Use BLOCK_FOR_INSN for resolving LABEL_REFs.
authorRichard Henderson <rth@redhat.com>
Sat, 15 Feb 2003 21:37:22 +0000 (13:37 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 15 Feb 2003 21:37:22 +0000 (13:37 -0800)
        * gcse.c (bypass_block): Use BLOCK_FOR_INSN for resolving LABEL_REFs.
        (bypass_conditional_jumps): Accept computed_jump_p insns as well.

From-SVN: r62945

gcc/ChangeLog
gcc/gcse.c

index 0942b3ab6fa750f6bc2fe56e6bc2580d0a3fe0a6..26201f375d0afaf47256763701ee9fc3eb16d2fe 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-15  Richard Henderson  <rth@redhat.com>
+
+       * gcse.c (bypass_block): Use BLOCK_FOR_INSN for resolving LABEL_REFs.
+       (bypass_conditional_jumps): Accept computed_jump_p insns as well.
+
 2003-02-15  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000.h (processor_type): Add PPC440.
index 7389661813338f206828c5e4cd9cec37fb558554..f5bb66d0053d0ef486d6a812ec7614ecb04fdb9a 100644 (file)
@@ -4809,7 +4809,7 @@ bypass_block (bb, setcc, jump)
          if (new == pc_rtx)
            dest = FALLTHRU_EDGE (bb)->dest;
          else if (GET_CODE (new) == LABEL_REF)
-           dest = BRANCH_EDGE (bb)->dest;
+           dest = BLOCK_FOR_INSN (XEXP (new, 0));
          else
            dest = NULL;
 
@@ -4848,7 +4848,9 @@ bypass_block (bb, setcc, jump)
 /* Find basic blocks with more than one predecessor that only contain a
    single conditional jump.  If the result of the comparison is known at
    compile-time from any incoming edge, redirect that edge to the
-   appropriate target.  Returns nonzero if a change was made.  */
+   appropriate target.  Returns nonzero if a change was made.
+
+   This function is now mis-named, because we also handle indirect jumps.  */
 
 static int
 bypass_conditional_jumps ()
@@ -4891,7 +4893,8 @@ bypass_conditional_jumps ()
              }
            else if (GET_CODE (insn) == JUMP_INSN)
              {
-               if (any_condjump_p (insn) && onlyjump_p (insn))
+               if ((any_condjump_p (insn) || computed_jump_p (insn))
+                   && onlyjump_p (insn))
                  changed |= bypass_block (bb, setcc, insn);
                break;
              }