]> gcc.gnu.org Git - gcc.git/commitdiff
cse.c (cse_insn): Avoid creating direct non-local jumps.
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 28 Sep 2004 23:29:02 +0000 (23:29 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 28 Sep 2004 23:29:02 +0000 (23:29 +0000)
* cse.c (cse_insn): Avoid creating direct non-local jumps.
* combine.c (can_combine_p): Likewise.
* local-alloc. (update_equiv_regs): Likewise.

From-SVN: r88258

gcc/ChangeLog
gcc/combine.c
gcc/cse.c
gcc/local-alloc.c

index 69229c2d13c7c2a55d0f67d1570af477673c6b14..129c408820456c548162398e01ca38564acf422a 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-28  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * cse.c (cse_insn): Avoid creating direct non-local jumps.
+       * combine.c (can_combine_p): Likewise.
+       * local-alloc. (update_equiv_regs): Likewise.
+
 2004-09-28  Richard Henderson  <rth@redhat.com>
 
        PR 17531
index ad5ec6483a3b5f9a78b3f365f0a02db78e98c098..2c7fbf5e74dc93b63c9d8b38438a48ee06b81b61 100644 (file)
@@ -1176,6 +1176,8 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ,
       /* Don't substitute into an incremented register.  */
       || FIND_REG_INC_NOTE (i3, dest)
       || (succ && FIND_REG_INC_NOTE (succ, dest))
+      /* Don't substitute into a non-local goto, this confuses CFG.  */
+      || (JUMP_P (i3) && find_reg_note (i3, REG_NON_LOCAL_GOTO, NULL_RTX))
 #if 0
       /* Don't combine the end of a libcall into anything.  */
       /* ??? This gives worse code, and appears to be unnecessary, since no
index ca577c5de6b3d49b99b308e3d09c5ed9cf9be7ba..651203d1064c944be77eb761e0ac04fbf26f2461 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5395,6 +5395,11 @@ cse_insn (rtx insn, rtx libcall_insn)
                  || (GET_CODE (trial) == LABEL_REF
                      && ! condjump_p (insn))))
            {
+             /* Don't substitute non-local labels, this confuses CFG.  */
+             if (GET_CODE (trial) == LABEL_REF
+                 && LABEL_REF_NONLOCAL_P (trial))
+               continue;
+
              SET_SRC (sets[i].rtl) = trial;
              cse_jumps_altered = 1;
              break;
index a01b99a04250d7740e4897d5f9e8b3dc3b2ca431..64db8c4258f692a483678220879bda070b8ddffe 100644 (file)
@@ -1010,6 +1010,11 @@ update_equiv_regs (void)
          if (! INSN_P (insn))
            continue;
 
+         /* Don't substitute into a non-local goto, this confuses CFG.  */
+         if (JUMP_P (insn)
+             && find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
+           continue;
+
          for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
            {
              if (REG_NOTE_KIND (link) == REG_DEAD
This page took 0.093676 seconds and 5 git commands to generate.