]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fix PR target/42841
authorChristian Bruel <christian.bruel@st.com>
Tue, 26 Jan 2010 07:28:05 +0000 (08:28 +0100)
committerChristian Bruel <chrbr@gcc.gnu.org>
Tue, 26 Jan 2010 07:28:05 +0000 (08:28 +0100)
From-SVN: r156231

gcc/ChangeLog
gcc/config/sh/sh.c

index 03045ec2966be75162772c9d3bab6cb97bb7e82b..86c7e34e01fc29f797ebb3ca8dda86e9895384e0 100644 (file)
@@ -1,3 +1,10 @@
+2010-01-25  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/42841
+       * config/sh/sh.c (find_barrier): Increase length for non delayed
+       conditional branches.
+       (sh_insn_length_adjustment): Use JUMP_TABLE_DATA_P.
+
 2010-01-24  David S. Miller  <davem@davemloft.net>
 
        * gcc/config/sparc/sysv4.h (TARGET_ASM_NAMED_SECTION): Only
index fa54872eff29e2178a01ba3449df4dedbc7f606a..2db614209a404d6a1608e2da79455c7712e350cd 100644 (file)
@@ -4020,6 +4020,13 @@ find_barrier (int num_mova, rtx mova, rtx from)
               && ! TARGET_SMALLCODE)
        new_align = 4;
 
+      /* There is a possibility that a bf is transformed into a bf/s by the
+        delay slot scheduler.  */
+      if (JUMP_P (from) && !JUMP_TABLE_DATA_P (from) 
+         && get_attr_type (from) == TYPE_CBRANCH
+         && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (from)))) != SEQUENCE)
+       inc += 2;
+
       if (found_si)
        {
          count_si += inc;
@@ -8451,9 +8458,7 @@ sh_insn_length_adjustment (rtx insn)
        && GET_CODE (PATTERN (insn)) != USE
        && GET_CODE (PATTERN (insn)) != CLOBBER)
        || GET_CODE (insn) == CALL_INSN
-       || (GET_CODE (insn) == JUMP_INSN
-          && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
-          && GET_CODE (PATTERN (insn)) != ADDR_VEC))
+       || (JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn)))
       && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE
       && get_attr_needs_delay_slot (insn) == NEEDS_DELAY_SLOT_YES)
     return 2;
@@ -8461,9 +8466,7 @@ sh_insn_length_adjustment (rtx insn)
   /* SH2e has a bug that prevents the use of annulled branches, so if
      the delay slot is not filled, we'll have to put a NOP in it.  */
   if (sh_cpu == CPU_SH2E
-      && GET_CODE (insn) == JUMP_INSN
-      && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
-      && GET_CODE (PATTERN (insn)) != ADDR_VEC
+      && JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn)
       && get_attr_type (insn) == TYPE_CBRANCH
       && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE)
     return 2;