]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* jump.c (jump_optimize_1): More accurately detect casesi insns.
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 21 Oct 1999 06:24:03 +0000 (06:24 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 21 Oct 1999 06:24:03 +0000 (00:24 -0600)
From-SVN: r30114

gcc/ChangeLog
gcc/jump.c

index 093aaf6144bd3831c6e8af33e641e82293bdc161..35d9c62cc9ec2baff3c5bed2f12eef9ba2947e76 100644 (file)
@@ -1,3 +1,7 @@
+Wed Oct 20 10:46:41 1999  Richard Earnshaw (rearnsha@arm.com)
+
+       * jump.c (jump_optimize_1): More accurately detect casesi insns.
+
 Wed Oct 20 22:57:58 1999  Jeffrey A Law  (law@cygnus.com)
 
        * sparc.md (movsf_const_intreg): If splitting, length must be > 1.
index 6259433efd5ef306fe7fb2c92303cc2fce23e071..32eebd1eb6c0dc42320720bd0a72c4289eec261c 100644 (file)
@@ -371,19 +371,23 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
              int diff_vec_p = GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC;
              int len = XVECLEN (pat, diff_vec_p);
              rtx dispatch = prev_real_insn (insn);
+             rtx set;
 
              for (i = 0; i < len; i++)
                if (XEXP (XVECEXP (pat, diff_vec_p, i), 0)
                    != XEXP (XVECEXP (pat, diff_vec_p, 0), 0))
                  break;
+
              if (i == len
                  && dispatch != 0
                  && GET_CODE (dispatch) == JUMP_INSN
                  && JUMP_LABEL (dispatch) != 0
-                 /* Don't mess with a casesi insn.  */
-                 && !(GET_CODE (PATTERN (dispatch)) == SET
-                      && (GET_CODE (SET_SRC (PATTERN (dispatch)))
-                          == IF_THEN_ELSE))
+                 /* Don't mess with a casesi insn. 
+                    XXX according to the comment before computed_jump_p(),
+                    all casesi insns should be a parallel of the jump
+                    and a USE of a LABEL_REF.  */
+                 && ! ((set = single_set (dispatch)) != NULL
+                       && (GET_CODE (SET_SRC (set)) == IF_THEN_ELSE))
                  && next_real_insn (JUMP_LABEL (dispatch)) == insn)
                {
                  redirect_tablejump (dispatch,