* config/tc-mips.c (append_insn): Also handle moving delay-slot
	instruction across frags for fixed branches.

	gas/testsuite/
	* gas/mips/branch-swap-2.l: New list test.
	* gas/mips/branch-swap-2.s: New test source.
	* gas/mips/mips.exp: Run the new test.
This commit is contained in:
Maciej W. Rozycki 2012-08-06 20:33:00 +00:00
parent 7bb15c6f21
commit 464ab0e55a
6 changed files with 35 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2012-08-06 Maciej W. Rozycki <macro@codesourcery.com>
* config/tc-mips.c (append_insn): Also handle moving delay-slot
instruction across frags for fixed branches.
2012-08-03 Maciej W. Rozycki <macro@codesourcery.com>
* frags.c (frag_grow): Never shrink the obstack size requested

View file

@ -4488,7 +4488,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
move_insn (ip, delay.frag, delay.where);
move_insn (&delay, ip->frag, ip->where + insn_length (ip));
}
else if (relaxed_branch)
else if (relaxed_branch || delay.frag != ip->frag)
{
/* Add the delay slot instruction to the end of the
current frag and shrink the fixed part of the

View file

@ -1,3 +1,9 @@
2012-08-06 Maciej W. Rozycki <macro@codesourcery.com>
* gas/mips/branch-swap-2.l: New list test.
* gas/mips/branch-swap-2.s: New test source.
* gas/mips/mips.exp: Run the new test.
2012-08-06 Roland McGrath <mcgrathr@google.com>
* gas/i386/x86-64-stack.s: Add cases for push immediate.

View file

@ -0,0 +1 @@
# No warnings or errors expected!

View file

@ -0,0 +1,8 @@
.set micromips
.text
foo:
.rept count
ori $2, $3, (. - foo) >> 2
.endr
addu $2, $3, $4
j ext

View file

@ -505,6 +505,20 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test_arches "branch-misc-2pic-64" [mips_arch_list_matching mips3]
run_dump_test "branch-misc-3"
run_dump_test "branch-swap"
if $elf {
# Sweep a range of branch offsets so that it hits a position where
# it is at the beginning of a frag and then swapped with a 16-bit
# instruction from the preceding frag. The offset will be somewhere
# close below 4096 as this is the default obstack size limit that
# we use and some space will have been already consumed. The exact
# amount depends on the host's programming model.
for { set count 960 } { $count <= 1024 } { incr count } {
run_list_test "branch-swap-2" "--defsym count=$count" \
"MIPS branch swapping ($count)"
}
}
run_dump_test "div"
if { !$addr32 } {