diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-02-08 10:28:52 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-02-20 11:49:48 -0800 |
commit | cd665a945eccba1406696c65ac7eebb12a355446 (patch) | |
tree | a3982708d2d39792d56384e59144d9143d8d91c4 /gas/testsuite | |
parent | 7104e59bece90e387d70f617eb7ed4c34087283d (diff) | |
download | gdb-cd665a945eccba1406696c65ac7eebb12a355446.zip gdb-cd665a945eccba1406696c65ac7eebb12a355446.tar.gz gdb-cd665a945eccba1406696c65ac7eebb12a355446.tar.bz2 |
gas: xtensa: limit size of auto litpools
Literal movement code may grow auto litpool so big that it won't be
possible to jump around it. Limit the size of auto litpools by 1/2 of
the jump range.
gas/
2018-02-20 Max Filippov <jcmvbkbc@gmail.com>
* config/tc-xtensa.c (struct litpool_frag): Add new field
literal_count.
(MAX_AUTO_POOL_LITERALS, MAX_EXPLICIT_POOL_LITERALS)
(MAX_POOL_LITERALS): New macro definitions.
(auto_litpool_limit): Initialize to 0.
(md_parse_option): Set auto_litpool_limit in the presence of
--auto-litpools option.
(xtensa_maybe_create_literal_pool_frag): Zero-initialize
literal_count field.
(xg_find_litpool): New function. Make sure that found literal
pool size is within the limit.
(xtensa_move_literals): Extract literal pool search code into
the new function.
* testsuite/gas/xtensa/all.exp: Add auto-litpools-2 test.
* testsuite/gas/xtensa/auto-litpools-2.d: New file.
* testsuite/gas/xtensa/auto-litpools-2.s: New file.
* testsuite/gas/xtensa/auto-litpools.d: Fix up changed
addresses.
* testsuite/gas/xtensa/auto-litpools.s: Change literal value so
that objdump doesn't get out of sync.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/xtensa/all.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/auto-litpools-2.d | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/auto-litpools-2.s | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/auto-litpools.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/auto-litpools.s | 2 |
5 files changed, 19 insertions, 3 deletions
diff --git a/gas/testsuite/gas/xtensa/all.exp b/gas/testsuite/gas/xtensa/all.exp index c0dd8a5..650a932 100644 --- a/gas/testsuite/gas/xtensa/all.exp +++ b/gas/testsuite/gas/xtensa/all.exp @@ -102,6 +102,7 @@ if [istarget xtensa*-*-*] then { run_list_test "trampoline-2" run_dump_test "first_frag_align" run_dump_test "auto-litpools" + run_dump_test "auto-litpools-2" run_dump_test "auto-litpools-first1" run_dump_test "auto-litpools-first2" run_dump_test "loc" diff --git a/gas/testsuite/gas/xtensa/auto-litpools-2.d b/gas/testsuite/gas/xtensa/auto-litpools-2.d new file mode 100644 index 0000000..d153c2b --- /dev/null +++ b/gas/testsuite/gas/xtensa/auto-litpools-2.d @@ -0,0 +1,6 @@ +#as: --auto-litpools +#objdump: -d +#name: auto litpool size limitation + +.*: +file format .*xtensa.* +#... diff --git a/gas/testsuite/gas/xtensa/auto-litpools-2.s b/gas/testsuite/gas/xtensa/auto-litpools-2.s new file mode 100644 index 0000000..30b1383 --- /dev/null +++ b/gas/testsuite/gas/xtensa/auto-litpools-2.s @@ -0,0 +1,9 @@ + .text + .global _start +_start: + j 1f + .rep 33000 + movi a2, 0xf03df03d + .endr +1: + ret diff --git a/gas/testsuite/gas/xtensa/auto-litpools.d b/gas/testsuite/gas/xtensa/auto-litpools.d index fc6f5cb..8eadd1f 100644 --- a/gas/testsuite/gas/xtensa/auto-litpools.d +++ b/gas/testsuite/gas/xtensa/auto-litpools.d @@ -6,7 +6,7 @@ #... .*8:.*l32r.a2, 4 .* #... -.*3e43b:.*j.3e444 .* +.*3f029:.*j.3f030 .* #... -.*40754:.*l32r.a2, 3e440 .* +.*40752:.*l32r.a2, 3f02c .* #... diff --git a/gas/testsuite/gas/xtensa/auto-litpools.s b/gas/testsuite/gas/xtensa/auto-litpools.s index 9a5b26b..aa42415 100644 --- a/gas/testsuite/gas/xtensa/auto-litpools.s +++ b/gas/testsuite/gas/xtensa/auto-litpools.s @@ -1,7 +1,7 @@ .text .align 4 .literal .L0, 0x12345 - .literal .L1, 0x12345 + .literal .L1, 0x78f078f0 f: l32r a2, .L0 |