]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport a change to the 2.95 branch
authorBernd Schmidt <bernds@redhat.co.uk>
Thu, 30 Nov 2000 13:32:39 +0000 (13:32 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 30 Nov 2000 13:32:39 +0000 (13:32 +0000)
From-SVN: r37890

gcc/ChangeLog
gcc/loop.c

index 8082886f767036a7f3482db9f0b0327cf5eefa78..1456bc36b982eefbee0f608a745cb53f64cda73b 100644 (file)
@@ -1,5 +1,9 @@
 2000-11-30  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       Sun Oct 10 13:28:48 1999  Bernd Schmidt  <bernds@redhat.co.uk>
+       * loop.c (find_and_verify_loops): When looking for a BARRIER, don't
+       use one before a jump table.
+
        Fri Jul  9 10:48:28 1999  Bernd Schmidt  <bernds@redhat.co.uk>
        * loop.c (check_dbra_loop): When reversing a loop, delete all
        REG_EQUAL notes referencing the reversed biv except those which are
index 1f6841d5d8d19994ff08d14a0e30ea19346554d2..0b121cb918c5d80150e15a62ba2ad17e2e6b82e2 100644 (file)
@@ -2829,16 +2829,30 @@ find_and_verify_loops (f)
                rtx target
                  = JUMP_LABEL (insn) ? JUMP_LABEL (insn) : get_last_insn ();
                int target_loop_num = uid_loop_num[INSN_UID (target)];
-               rtx loc;
+               rtx loc, loc2;
 
                for (loc = target; loc; loc = PREV_INSN (loc))
                  if (GET_CODE (loc) == BARRIER
+                     /* Don't move things inside a tablejump.  */
+                     && ((loc2 = next_nonnote_insn (loc)) == 0
+                         || GET_CODE (loc2) != CODE_LABEL
+                         || (loc2 = next_nonnote_insn (loc2)) == 0
+                         || GET_CODE (loc2) != JUMP_INSN
+                         || (GET_CODE (PATTERN (loc2)) != ADDR_VEC
+                             && GET_CODE (PATTERN (loc2)) != ADDR_DIFF_VEC))
                      && uid_loop_num[INSN_UID (loc)] == target_loop_num)
                    break;
 
                if (loc == 0)
                  for (loc = target; loc; loc = NEXT_INSN (loc))
                    if (GET_CODE (loc) == BARRIER
+                       /* Don't move things inside a tablejump.  */
+                       && ((loc2 = next_nonnote_insn (loc)) == 0
+                           || GET_CODE (loc2) != CODE_LABEL
+                           || (loc2 = next_nonnote_insn (loc2)) == 0
+                           || GET_CODE (loc2) != JUMP_INSN
+                           || (GET_CODE (PATTERN (loc2)) != ADDR_VEC
+                               && GET_CODE (PATTERN (loc2)) != ADDR_DIFF_VEC))
                        && uid_loop_num[INSN_UID (loc)] == target_loop_num)
                      break;