From f7870c8d99fd6d6c6d29b5c34cd27a8bbe04417f Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Wed, 18 Aug 2004 15:58:12 +0000 Subject: [PATCH] * config/tc-mips.c (append_insn): Handle delay slots in branch likely correctly. --- gas/ChangeLog | 4 ++++ gas/config/tc-mips.c | 1 + gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/mips/branch-swap.d | 20 ++++++++++++++++++++ gas/testsuite/gas/mips/branch-swap.s | 9 +++++++++ gas/testsuite/gas/mips/mips.exp | 1 + 6 files changed, 40 insertions(+) create mode 100644 gas/testsuite/gas/mips/branch-swap.d create mode 100644 gas/testsuite/gas/mips/branch-swap.s diff --git a/gas/ChangeLog b/gas/ChangeLog index ddf8fa77ec5..b0dcda7201e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2004-08-18 Thiemo Seufer + * config/tc-mips.c (append_insn): Handle delay slots in branch likely + correctly. + 2004-08-18 Jakub Jelinek * config/tc-ia64.c (start_unwind_section): Add linkonce_empty diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 108b912bd3f..fd76eabb5ac 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -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 { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 39e89c3fbd2..4f3e5a1ad47 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-18 Thiemo Seufer + * 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 * 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 index 00000000000..74c149d2cb1 --- /dev/null +++ b/gas/testsuite/gas/mips/branch-swap.d @@ -0,0 +1,20 @@ +#as: -march=mips2 +#objdump: -dr +#name: MIPS branch-swap + +.*: file format .*mips.* + +Disassembly of section \.text: + +00000000 : + 0: 5040ffff beqzl v0,0 + 4: 00000000 nop + 8: 1000fffd b 0 + c: 00000000 nop + +00000010 : + 10: 5040ffff beqzl v0,10 + 14: 00000000 nop + 18: 1000fffd b 10 + 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 index 00000000000..cd888add5d1 --- /dev/null +++ b/gas/testsuite/gas/mips/branch-swap.s @@ -0,0 +1,9 @@ + .set push + .set mips2 +1: beqzl $2, 1b + b 1b +foo: beqzl $2, foo + b foo + + .set pop + .space 8 diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index 311f15235e7..bd36ec244eb 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -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" -- 2.30.2