Fix trampolines search code for conditional branches
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 25 Nov 2014 18:33:21 +0000 (21:33 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 25 Nov 2014 21:17:36 +0000 (00:17 +0300)
commitd92b6eece424f0ad35d96fdd85bf207295e8c4c3
treefd0ea7b82607c32bc16c4c000b2a85e2e3e31dd2
parent60bb06bc89858ee50ad02907a833565dcc317182
Fix trampolines search code for conditional branches

For conditional branches that need more than one trampoline to reach its
target assembler couldn't always find suitable trampoline because
post-loop condition check was placed inside the loop, resulting in
premature loop termination. Move check outside the loop.

This fixes the following build errors seen when assembling huge files
produced by gcc:
    Error: jump target out of range; no usable trampoline found
    Error: operand 1 of 'j' has out of range value '307307'

2014-11-25  Max Filippov  <jcmvbkbc@gmail.com>

gas/
* config/tc-xtensa.c (search_trampolines): Move post-loop
condition check outside the search loop.

gas/testsuite/
* gas/xtensa/trampoline.d: Add expected output for branches.
* gas/xtensa/trampoline.s: Add test case for branches.
gas/ChangeLog
gas/config/tc-xtensa.c
gas/testsuite/ChangeLog
gas/testsuite/gas/xtensa/trampoline.d
gas/testsuite/gas/xtensa/trampoline.s