This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6
- From: Dragan Mladjenovic <dmladjenovic at wavecomp dot com>
- To: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: Dragan Mladjenovic <dmladjenovic at wavecomp dot com>, Joseph Myers <joseph at codesourcery dot com>
- Date: Tue, 19 Nov 2019 14:56:43 +0000
- Subject: [PATCH] mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wavecomp.com; dmarc=pass action=none header.from=wavecomp.com; dkim=pass header.d=wavecomp.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jmL4JBVONHwTjWmwdHcZMFlEbRK0z0cQAJRc0yAIHSI=; b=XfkJU7u2sno+25pBEJ9ae0QncCgZR6uHWspluMbM3RAFPcWxDoBq8KKkvOmtNKd/uG966Ff9cgEMIFT/SFrFq70KtgnrpeBQEyx/tPxD09Id8yUF2a9pfvXECCZo2cmDDKLDPTimvM8WgAK3/pYWk/JRljse8DX75JCuZCOHi0xTF8VoCs3dr1kdjjze7D6SfHzmWiQcQB7pp77PA1IRXW0JXhNzHYn4IfJfhWYTmWuoLW+J9WnrYxUheI1+g5/4M7W9PnJP+Vx+/Ub3JaO7pCOC435Mr+rVNLq4bE0kRwzup91J5Vns5KeRcEypmLqU8JH8y1rLs9kfGPpIQ8kNog==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XG/XRi0j8jxjXTCofrRkpQGrbvUwJMCAXKcFaUUAKqTHB0PTrcsU2yZe7LGjgXqL2lqLJnPVul9AeyT6IKoipowSn3fCv1UH1qHqmiw1tUWS3CpzURAdDYKO6wleHw1ZN+Ttb4KbBUzUezFcp+fAFoMiIO3oqa8UWbU+34semJJv38sb4Jo1j5tZ9dGBOYHh0rSddqx/xhfBXtVGAzu6WQttrjaG3F7NXqvqSNN3PPRavnqccnMnLjLHIc01xHfTwsM/ExQGqyMmgJyBXLSm/0Qfqj78Z3/wy2B8Zdd3EcxErvqzEc3dRslvAgjuMZuE2uhQmmybPidjNk4a9bbbUg==
From: "Dragan Mladjenovic" <dmladjenovic@wavecomp.com>
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 | 9 +++++++--
sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h | 9 +++++++--
sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h | 9 +++++++--
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index 86347fe..cbc2a4b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -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__ */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index ca7a60e..fd16508 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -294,8 +294,13 @@
_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__ */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index 821dec9..8df4d9b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -290,8 +290,13 @@
_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__ */
--
1.9.1