gas: xtensa: fix incorrect code generated with auto litpools
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 10 Apr 2017 12:12:52 +0000 (13:12 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 10 Apr 2017 12:12:52 +0000 (13:12 +0100)
commit947fa9141488c1d39303fcdaa056332d2d0b2599
treea39cb09310958310a7bb3692a0156769e1d01472
parentbb1dd176fb6f38ae3cc30dc61ce55a7fbf9d0d7b
gas: xtensa: fix incorrect code generated with auto litpools

* config/tc-xtensa.c (xtensa_maybe_create_literal_pool_frag):
Initialize lps->frag_count with auto_litpool_limit.
(xg_promote_candidate_litpool): New function.
(xtensa_move_literals): Extract candidate litpool promotion code
into separate function. Call it for all possible found
candidates.
(xtensa_switch_to_literal_fragment): Drop 'recursive' flag and
call to xtensa_mark_literal_pool_location that it guards.
Replace it with call to xtensa_maybe_create_literal_pool_frag.
Initialize pool_location with created literal pool candidate.
* testsuite/gas/xtensa/all.exp: Add new tests.
* testsuite/gas/xtensa/auto-litpools-first1.d: New test results.
* testsuite/gas/xtensa/auto-litpools-first1.s: New test.
* testsuite/gas/xtensa/auto-litpools-first2.d: New test results.
* testsuite/gas/xtensa/auto-litpools-first2.s: New test.
* testsuite/gas/xtensa/auto-litpools.d: Fix offsets changed due
to additional jump instruction.
gas/ChangeLog
gas/config/tc-xtensa.c
gas/testsuite/gas/xtensa/all.exp
gas/testsuite/gas/xtensa/auto-litpools-first1.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/auto-litpools-first1.s [new file with mode: 0644]
gas/testsuite/gas/xtensa/auto-litpools-first2.d [new file with mode: 0644]
gas/testsuite/gas/xtensa/auto-litpools-first2.s [new file with mode: 0644]
gas/testsuite/gas/xtensa/auto-litpools.d