re PR rtl-optimization/9387 (jump threading bug)
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>
Sat, 15 Mar 2003 02:44:29 +0000 (02:44 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Sat, 15 Mar 2003 02:44:29 +0000 (02:44 +0000)
PR optimization/9387
* function.c (thread_prologue_and_epilogue_insns): Use redirect_jump
for conditional returns.

From-SVN: r64390

gcc/ChangeLog
gcc/function.c

index 146eb18973bbf4bcef4729dee95e77b815ac3020..206fffc9567b678c141254fe0c6a1766c6b80539 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-15  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       PR optimization/9387
+       * function.c (thread_prologue_and_epilogue_insns): Use redirect_jump
+       for conditional returns.
+
 2003-03-14  Jason Merrill  <jason@redhat.com>
 
        PR optimization/6871
index 73527bc037e453981bf59144b33ba7969987d55d..26fc9ecca76993dba38750cce82cf54b64fb378b 100644 (file)
@@ -7601,19 +7601,8 @@ thread_prologue_and_epilogue_insns (f)
                 that with a conditional return instruction.  */
              else if (condjump_p (jump))
                {
-                 rtx ret, *loc;
-
-                 ret = SET_SRC (PATTERN (jump));
-                 if (GET_CODE (XEXP (ret, 1)) == LABEL_REF)
-                   loc = &XEXP (ret, 1);
-                 else
-                   loc = &XEXP (ret, 2);
-                 ret = gen_rtx_RETURN (VOIDmode);
-
-                 if (! validate_change (jump, loc, ret, 0))
+                 if (! redirect_jump (jump, 0, 1))
                    continue;
-                 if (JUMP_LABEL (jump))
-                   LABEL_NUSES (JUMP_LABEL (jump))--;
 
                  /* If this block has only one successor, it both jumps
                     and falls through to the fallthru block, so we can't