re PR target/35190 (Wrong branch instruction with -freorder-blocks-and-partition...
authorKaz Kojima <kkojima@gcc.gnu.org>
Wed, 20 Feb 2008 23:35:41 +0000 (23:35 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Wed, 20 Feb 2008 23:35:41 +0000 (23:35 +0000)
PR target/35190
* config/sh/sh.md (jump_compact): Disable for crossing jumps.

* config/sh/sh.c (find_barrier): Don't go past
NOTE_INSN_SWITCH_TEXT_SECTIONS note.

From-SVN: r132502

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

index fc400d26ae5ec6ab89dd63822192d70233408210..4245df642f17d769fce09576cc106a7a8f472651 100644 (file)
@@ -1,3 +1,11 @@
+2008-02-20  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/35190
+       * config/sh/sh.md (jump_compact): Disable for crossing jumps.
+
+       * config/sh/sh.c (find_barrier): Don't go past
+       NOTE_INSN_SWITCH_TEXT_SECTIONS note.
+
 2008-02-20  DJ Delorie  <dj@redhat.com>
 
        * config/h8300/h8300.md (insv): Force source operand to be a register.
index 4088ef73cdfb775ab93c80de1007e3d52ceb470f..37abdf6ae49453729ad7be18d8aed1183e7e3d27 100644 (file)
@@ -3897,6 +3897,7 @@ find_barrier (int num_mova, rtx mova, rtx from)
 
       if (GET_CODE (from) == BARRIER)
        {
+         rtx next;
 
          found_barrier = from;
 
@@ -3905,6 +3906,14 @@ find_barrier (int num_mova, rtx mova, rtx from)
             this kind of barrier.  */
          if (barrier_align (from) > 2)
            good_barrier = from;
+
+         /* If we are at the end of a hot/cold block, dump the constants
+            here.  */
+         next = NEXT_INSN (from);
+         if (next
+             && NOTE_P (next)
+             && NOTE_KIND (next) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
+           break;
        }
 
       if (broken_move (from))
index d7e2727adac32e71af30586c5d93aac2e3470b59..5a580b517cd88ff360bbc33100aae7dc265253b4 100644 (file)
@@ -7378,7 +7378,7 @@ label:
 (define_insn "jump_compact"
   [(set (pc)
        (label_ref (match_operand 0 "" "")))]
-  "TARGET_SH1"
+  "TARGET_SH1 && !find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX)"
   "*
 {
   /* The length is 16 if the delay slot is unfilled.  */