Hi,
the S/390 inline asm for HOST_c2l and HOST_l2c seems to be broken currently.
The "r" constraint should not be used for an address register since that allows
r0 to be chosen by the compiler. r0 as part of an address is special and
evaluates to 0. This causes testsuite failures for md4 and ripemd.
Fixed with the attached patch. Please apply if you think the patch is ok.
Bye,
-Andreas-
Index: openssl-0.9.8l/crypto/md32_common.h
===================================================================
--- openssl-0.9.8l.orig/crypto/md32_common.h
+++ openssl-0.9.8l/crypto/md32_common.h
@@ -241,11 +241,11 @@
#ifndef PEDANTIC
# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) &&
!defined(OPENSSL_NO_INLINE_ASM)
# if defined(__s390x__)
-# define HOST_c2l(c,l) ({ asm ("lrv %0,0(%1)" \
- :"=r"(l) : "r"(c)); \
+# define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \
+ : "=d" (l) : "m" (*(unsigned int*)c)); \
(c)+=4; (l); })
-# define HOST_l2c(l,c) ({ asm ("strv %0,0(%1)" \
- : : "r"(l),"r"(c) : "memory"); \
+# define HOST_l2c(l,c) ({ asm ("strv %1,%0" \
+ : "=m" (*(unsigned int*)c) : "d" (l)); \
(c)+=4; (l); })
# endif
# endif