This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] xtensa: fix gas trampolines regression
- From: Max Filippov <jcmvbkbc at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Sterling Augustine <augustine dot sterling at gmail dot com>, David Weatherford <weath at cadence dot com>, Marc Gauthier <marc at cadence dot com>, linux-xtensa at linux-xtensa dot org, Max Filippov <jcmvbkbc at gmail dot com>
- Date: Sun, 10 May 2015 02:53:37 +0300
- Subject: [PATCH] xtensa: fix gas trampolines regression
- Authentication-results: sourceware.org; auth=none
Extra condition 'abs (addr - trampaddr) < J_RANGE / 2' for trampoline
selection results in regressions: when relaxable jump is little longer
than J_RANGE so that single trampoline makes two new jumps, one longer
than J_RANGE / 2 and one shorter, correct trampoline cannot be found.
Drop that condition.
2015-05-10 Max Filippov <jcmvbkbc@gmail.com>
gas/
* config/tc-xtensa.c (xtensa_relax_frag): Allow trampoline to be
closer than J_RANGE / 2 to jump frag.
gas/testsuite/
* gas/xtensa/trampoline.s: Add regression testcase.
---
gas/config/tc-xtensa.c | 3 +--
gas/testsuite/gas/xtensa/trampoline.s | 10 ++++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index b1827fa..31c0b6b 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -9071,8 +9071,7 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
trampaddr = fragP->fr_address + fragP->fr_fix;
- if ((addr + J_RANGE < trampaddr) ||
- abs (addr - trampaddr) < J_RANGE / 2)
+ if (addr + J_RANGE < trampaddr)
continue;
if (addr > trampaddr + J_RANGE)
break;
diff --git a/gas/testsuite/gas/xtensa/trampoline.s b/gas/testsuite/gas/xtensa/trampoline.s
index 4465786..3cfbe97 100644
--- a/gas/testsuite/gas/xtensa/trampoline.s
+++ b/gas/testsuite/gas/xtensa/trampoline.s
@@ -26,3 +26,13 @@
.endr
4:
j 4b
+
+5:
+ j 6f
+
+ .rep 43691
+ _nop
+ .endr
+
+6:
+ j 5b
--
1.8.1.4