summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPavel Kozlov <pavel.kozlov@synopsys.com>2022-09-20 20:54:20 +0400
committerWaldemar Brodkorb <wbx@openadk.org>2022-09-27 12:03:15 +0200
commit1f891b5655a6e3bd8c2beb0768ee97e8dcc3c9c0 (patch)
treebb0fc174467e1af44db50e12500581c2eb6bac42 /test
parent0bd32f727316c99569e19ae60790f29cc6770db6 (diff)
arc: fix TLS_GD macro, bad clobber list
Move function call outside the inline asm code to simplify a clobber list. The patch fixes tests tst-tls7 and tst-tls8 on ARCv3, they didn't pass because cc was not in clobber list and bad code was generated. The compiler didn't take in account changes of CPU Condition flags. Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Diffstat (limited to 'test')
-rw-r--r--test/tls/tls-macros-arc.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/tls/tls-macros-arc.h b/test/tls/tls-macros-arc.h
index 4b2d6f8..2f621d5 100644
--- a/test/tls/tls-macros-arc.h
+++ b/test/tls/tls-macros-arc.h
@@ -2,14 +2,12 @@
#define TLS_LD(x) TLS_IE(x)
#define TLS_GD(x) \
- ({ int *__result; \
- __asm__ ("add r0, pcl, @" #x "@tlsgd \n" \
- ".tls_gd_ld " #x "`bl __tls_get_addr@plt \n" \
- "mov %0, r0 \n" \
- : "=&r" (__result) \
- ::"r0","r1","r2","r3","r4","r5","r6","r7", \
- "r8","r9","r10","r11","r12"); \
- __result; })
+ ({ void *__result; \
+ extern void *__tls_get_addr (void *); \
+ __asm__ ("add %0, pcl, @" #x "@tlsgd \n" \
+ ".tls_gd_ld " #x " \n" \
+ : "=r" (__result)); \
+ (int *)__tls_get_addr(__result); })
#define TLS_LE(x) \
({ int *__result; \