Don't put things between tablejumps and jump tables in loop.c
authorBernd Schmidt <bernds@cygnus.co.uk>
Sun, 10 Oct 1999 11:37:46 +0000 (11:37 +0000)
committerBernd Schmidt <crux@gcc.gnu.org>
Sun, 10 Oct 1999 11:37:46 +0000 (11:37 +0000)
From-SVN: r29887

gcc/ChangeLog
gcc/loop.c

index fe3500eac28ea4af3c8c118ea5d0718c9a0a2bf6..ab9aef9dee946854f0307c9114a274ee6d48cb61 100644 (file)
@@ -1,3 +1,8 @@
+Sun Oct 10 13:28:48 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
+
+       * loop.c (find_and_verify_loops): When looking for a BARRIER, don't
+       use one before a jump table.
+
 Sun Oct 10 02:41:41 1999  Richard Henderson  <rth@cygnus.com>
 
        * genrecog.c (add_to_sequence): Move allow_const_int test outside
index 40ed922a783b399a1a46faf30b56ad3780188f7a..ea815fff847a2969c56e704cef608f47d91c7357 100644 (file)
@@ -2841,16 +2841,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;