]> sourceware.org Git - glibc.git/commitdiff
mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6
authorDragan Mladjenovic <dmladjenovic@wavecomp.com>
Tue, 19 Nov 2019 14:06:20 +0000 (15:06 +0100)
committerdragan.mladjenovic <dragan.mladjenovic@rt-rk.com>
Mon, 16 Dec 2019 18:35:22 +0000 (19:35 +0100)
GCC 10 (PR 91233) won't silently allow registers that are not architecturally
available to be present in the clobber list anymore, resulting in build failure
for mips*r6 targets in form of:
...
.../sysdep.h:146:2: error: the register ‘lo’ cannot be clobbered in ‘asm’ for the current target
  146 |  __asm__ volatile (      \
      |  ^~~~~~~

This is because base R6 ISA doesn't define hi and lo registers w/o DSP extension.
This patch provides the alternative definitions of __SYSCALL_CLOBBERS for r6
targets that won't include those registers.

* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (__SYSCALL_CLOBBERS): Exclude
hi and lo from the clobber list for __mips_isa_rev >= 6.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (__SYSCALL_CLOBBERS): Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (__SYSCALL_CLOBBERS): Likewise.

sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h

index 86347fe91ac3408e89f08768051aa739f4c2a1eb..cbc2a4b927407cfd21f423b8ed5a236f9b3f4b1b 100644 (file)
@@ -346,8 +346,13 @@ libc_hidden_proto (__mips_syscall7, nomips16)
        _sc_ret.reg.v0;                                                 \
 })
 
-#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
-       "$14", "$15", "$24", "$25", "hi", "lo", "memory"
+#if __mips_isa_rev >= 6
+# define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
+        "$14", "$15", "$24", "$25", "memory"
+#else
+# define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \
+        "$14", "$15", "$24", "$25", "hi", "lo", "memory"
+#endif
 
 #endif /* __ASSEMBLER__ */
 
index ca7a60e3d7149941f251a98258a5621c9c74168b..fd16508215fd3024d92e1b488e388b6469c1249a 100644 (file)
        _sys_result;                                                    \
 })
 
-#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
-       "$14", "$15", "$24", "$25", "hi", "lo", "memory"
+#if __mips_isa_rev >= 6
+# define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+        "$14", "$15", "$24", "$25", "memory"
+#else
+# define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+        "$14", "$15", "$24", "$25", "hi", "lo", "memory"
+#endif
 
 #endif /* __ASSEMBLER__ */
 
index 821dec920ae14d6912c14a87c0203351c2505704..8df4d9b9611c4aba6c1fa3831fa94d38e1c4491a 100644 (file)
        _sys_result;                                                    \
 })
 
-#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
-       "$14", "$15", "$24", "$25", "hi", "lo", "memory"
+#if __mips_isa_rev >= 6
+# define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+        "$14", "$15", "$24", "$25", "memory"
+#else
+# define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+        "$14", "$15", "$24", "$25", "hi", "lo", "memory"
+#endif
 
 #endif /* __ASSEMBLER__ */
 
This page took 0.051335 seconds and 5 git commands to generate.