public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6
@ 2019-12-16 18:37 Dragan Mladjenovic
  0 siblings, 0 replies; only message in thread
From: Dragan Mladjenovic @ 2019-12-16 18:37 UTC (permalink / raw)
  To: glibc-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 3755 bytes --]

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=020b2a97bb15f807c0482f0faee2184ed05bcad8

commit 020b2a97bb15f807c0482f0faee2184ed05bcad8
Author: Dragan Mladjenovic <dmladjenovic@wavecomp.com>
Date:   Tue Nov 19 15:06:20 2019 +0100

    mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6
    
    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.

Diff:
---
 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__ */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-16 18:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16 18:37 [glibc] mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6 Dragan Mladjenovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).