* [PATCH] s390: fix string inline assemblies.
@ 2005-01-28 17:17 Martin Schwidefsky
2005-01-28 21:45 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Martin Schwidefsky @ 2005-01-28 17:17 UTC (permalink / raw)
To: libc-hacker
Hi,
compiling on s390* with -D__USE_STRING_INLINES and a newer gcc
generates broken code because of missing "memory" clobbers
on some of the string inline assemblies. Patch & ChangeLog
attached.
blue skies,
Martin.
2005-01-28 Martin Schwidefsky <schwidefsky@de.ibm.com>
* sysdeps/s390/bits/string.h (strlen, strncpy, strcat, strncat,
strncat, memchr, strcmp): Add missing memory clobber.
diff -urN libc/sysdeps/s390/bits/string.h libc-s390/sysdeps/s390/bits/string.h
--- libc/sysdeps/s390/bits/string.h 2005-01-28 15:57:54.000000000 +0100
+++ libc-s390/sysdeps/s390/bits/string.h 2005-01-28 15:54:51.000000000 +0100
@@ -51,7 +51,7 @@
"0: srst %0,%1\n"
" jo 0b\n"
: "+&a" (__ptr), "+&a" (__tmp) :
- : "cc", "0" );
+ : "cc", "memory", "0" );
return (size_t) (__ptr - __str);
}
#endif
@@ -105,7 +105,7 @@
#endif
"4:"
: "+&a" (__ptr), "+&a" (__n) : "a" (__diff)
- : "cc", "0" );
+ : "cc", "memory", "0" );
}
return __ret;
}
@@ -134,7 +134,7 @@
"0: mvst %0,%1\n"
" jo 0b"
: "+&a" (__ptr), "+&a" (__src) :
- : "cc", "0" );
+ : "cc", "memory", "0" );
return __ret;
}
#endif
@@ -157,7 +157,7 @@
"0: srst %0,%1\n"
" jo 0b\n"
: "+&a" (__ptr), "+&a" (__tmp) :
- : "cc", "0" );
+ : "cc", "memory", "0" );
__diff = (size_t) (__ptr - __src);
__tmp = (char *) __src;
@@ -175,7 +175,7 @@
" stc 0,1(%2,%0)\n"
"2:"
: "+&a" (__tmp), "+&a" (__n) : "a" (__diff)
- : "cc", "0" );
+ : "cc", "memory", "0" );
}
return __ret;
@@ -200,7 +200,7 @@
" la %0,0\n"
"1:"
: "+&a" (__ptr), "+&a" (__tmp) : "d" (__c)
- : "cc", "0" );
+ : "cc", "memory", "0" );
return __ptr;
}
#endif
@@ -222,7 +222,7 @@
" ipm %0\n"
" srl %0,28"
: "=d" (__ret), "+&a" (__p1), "+&a" (__p2) :
- : "cc", "0" );
+ : "cc", "memory", "0" );
__ret = (__ret == 0) ? 0 : (__ret == 1) ? -1 : 1;
return __ret;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] s390: fix string inline assemblies.
2005-01-28 17:17 [PATCH] s390: fix string inline assemblies Martin Schwidefsky
@ 2005-01-28 21:45 ` Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2005-01-28 21:45 UTC (permalink / raw)
To: Martin Schwidefsky; +Cc: libc-hacker
> 2005-01-28 Martin Schwidefsky <schwidefsky@de.ibm.com>
>
> * sysdeps/s390/bits/string.h (strlen, strncpy, strcat, strncat,
> strncat, memchr, strcmp): Add missing memory clobber.
I've put this in on the trunk. This seems a likely candidate for the
stable branch too, for which it needs a bugzilla entry.
Thanks,
Roland
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-28 21:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-28 17:17 [PATCH] s390: fix string inline assemblies Martin Schwidefsky
2005-01-28 21:45 ` Roland McGrath
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).