------- Additional Comments From dank at kegel dot com  2005-05-31 03:41 -------
See also http://marc.theaimsgroup.com/?l=openssl-dev&m=111238996923252&w=2
which says

--- snip ---
gcc-4 miscompiles inline assembly bn/asm/x86_64-gcc.c so that the
functions bn_add_words and bn_sub_words are broken and segfault.

This applies only to the stable branch as in the devel branch there is
added initialization of the ret and i variables. However the
initialization is unnecessary instead the code should be modified this way:

@@ -164,7 +186,7 @@
        "       leaq    1(%2),%2        \n"
        "       loop    1b              \n"
        "       sbbq    %0,%0           \n"
-               : "+a"(ret),"+c"(n),"+r"(i)
+               : "=&a"(ret),"+c"(n),"=&r"(i)
                : "r"(rp),"r"(ap),"r"(bp)
                : "cc"
        );
@@ -187,7 +209,7 @@
        "       leaq    1(%2),%2        \n"
        "       loop    1b              \n"
        "       sbbq    %0,%0           \n"
-               : "+a"(ret),"+c"(n),"+r"(i)
+               : "=&a"(ret),"+c"(n),"=&r"(i)
                : "r"(rp),"r"(ap),"r"(bp)
                : "cc"
        );
--- snip ---

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19558

Reply via email to