* config/tc-mips.c (append_insn): Handle delay slots in branch likely
authorThiemo Seufer <ths@networkno.de>
Wed, 18 Aug 2004 15:58:12 +0000 (15:58 +0000)
committerThiemo Seufer <ths@networkno.de>
Wed, 18 Aug 2004 15:58:12 +0000 (15:58 +0000)
correctly.

gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/branch-swap.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-swap.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index ddf8fa77ec5401a068dd7a4e863a1062a5a48cbb..b0dcda7201e86fcaa4aaaea0e513949e6737a725 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-18  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
+       * config/tc-mips.c (append_insn): Handle delay slots in branch likely
+       correctly.
+
 2004-08-18  Jakub Jelinek  <jakub@redhat.com>
 
        * config/tc-ia64.c (start_unwind_section): Add linkonce_empty
index 108b912bd3f7647b3139595b1bac3b230c84b9ad..fd76eabb5ac80dd9b380a8690073cfb0b3628118 100644 (file)
@@ -2711,6 +2711,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
          prev_insn_reloc_type[1] = BFD_RELOC_UNUSED;
          prev_insn_reloc_type[2] = BFD_RELOC_UNUSED;
          prev_insn_extended = 0;
+         prev_insn_is_delay_slot = 1;
        }
       else
        {
index 39e89c3fbd23e4e4f3509fdf0216045b68a6ffb5..4f3e5a1ad47d19113ec54a19b3e2d179ed4af978 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-18  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
+       * gas/mips/branch-swap.s: New testcase.
+       * gas/mips/branch-swap.d: New testcase.
+       * gas/mips/mips.exp: Run the testcase.
+
 2004-08-18  Nick Clifton  <nickc@redhat.com>
 
        * gas/macros/strings.s: Remove #NO_APP, accidentally committed as
diff --git a/gas/testsuite/gas/mips/branch-swap.d b/gas/testsuite/gas/mips/branch-swap.d
new file mode 100644 (file)
index 0000000..74c149d
--- /dev/null
@@ -0,0 +1,20 @@
+#as: -march=mips2
+#objdump: -dr
+#name: MIPS branch-swap
+
+.*:     file format .*mips.*
+
+Disassembly of section \.text:
+
+00000000 <foo-0x10>:
+   0:  5040ffff        beqzl   v0,0 <foo-0x10>
+   4:  00000000        nop
+   8:  1000fffd        b       0 <foo-0x10>
+   c:  00000000        nop
+
+00000010 <foo>:
+  10:  5040ffff        beqzl   v0,10 <foo>
+  14:  00000000        nop
+  18:  1000fffd        b       10 <foo>
+  1c:  00000000        nop
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/branch-swap.s b/gas/testsuite/gas/mips/branch-swap.s
new file mode 100644 (file)
index 0000000..cd888ad
--- /dev/null
@@ -0,0 +1,9 @@
+       .set push
+       .set mips2
+1:     beqzl   $2, 1b
+       b       1b
+foo:   beqzl   $2, foo
+       b       foo
+
+       .set pop
+       .space 8
index 311f15235e7ce3032bb2fed2cb4b111e547873af..bd36ec244eb88fba446a19176dfa1fbf86361aa2 100644 (file)
@@ -429,6 +429,7 @@ if { [istarget mips*-*-*] } then {
     run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1]
     run_list_test_arches "branch-misc-2" "-32 -non_shared" [mips_arch_list_matching mips1]
     run_list_test_arches "branch-misc-2pic" "-32 -call_shared" [mips_arch_list_matching mips1]
+    run_dump_test "branch-swap"
 
     if $ilocks {
        run_dump_test "div-ilocks"