Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src replace the previous hack with something that i believe is a...



details:   https://anonhg.NetBSD.org/src/rev/b5b3b47a5917
branches:  trunk
changeset: 345909:b5b3b47a5917
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Jun 15 05:01:58 2016 +0000

description:
replace the previous hack with something that i believe is actually
correct and, more importantly ;), works properly.

thanks for riastradh for hints about which bit was actually broken.

diffstat:

 crypto/external/bsd/openssh/dist/umac.c |  19 ++++++++-----------
 doc/HACKS                               |  14 +-------------
 2 files changed, 9 insertions(+), 24 deletions(-)

diffs (76 lines):

diff -r 8c4396a1d3f9 -r b5b3b47a5917 crypto/external/bsd/openssh/dist/umac.c
--- a/crypto/external/bsd/openssh/dist/umac.c   Wed Jun 15 04:33:52 2016 +0000
+++ b/crypto/external/bsd/openssh/dist/umac.c   Wed Jun 15 05:01:58 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umac.c,v 1.10 2016/06/15 02:12:14 mrg Exp $    */
+/*     $NetBSD: umac.c,v 1.11 2016/06/15 05:01:58 mrg Exp $    */
 /* $OpenBSD: umac.c,v 1.11 2014/07/22 07:13:42 guenther Exp $ */
 /* -----------------------------------------------------------------------
  * 
@@ -67,7 +67,7 @@
 /* ---------------------------------------------------------------------- */
 
 #include "includes.h"
-__RCSID("$NetBSD: umac.c,v 1.10 2016/06/15 02:12:14 mrg Exp $");
+__RCSID("$NetBSD: umac.c,v 1.11 2016/06/15 05:01:58 mrg Exp $");
 #include <sys/types.h>
 #include <sys/endian.h>
 #include <string.h>
@@ -566,9 +566,6 @@
 /* ---------------------------------------------------------------------- */
 
 #if (__LITTLE_ENDIAN__)
-#if __GNUC_PREREQ__(5, 3) && defined(__arm__)
-__attribute__((__optimize__("no-strict-aliasing")))
-#endif
 static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes)
 /* We endian convert the keys on little-endian computers to               */
 /* compensate for the lack of big-endian memory reads during hashing.     */
@@ -581,13 +578,13 @@
             p++;
         } while (--iters);
     } else if (bpw == 8) {
-        UINT32 *p = (UINT32 *)buf;
-        UINT32 t;
+        UINT64 *p = (UINT64 *)buf;
+        UINT64 th;
+        UINT64 t;
         do {
-            t = LOAD_UINT32_REVERSED(p+1);
-            p[1] = LOAD_UINT32_REVERSED(p);
-            p[0] = t;
-            p += 2;
+            t = LOAD_UINT32_REVERSED((UINT32 *)p+1);
+            th = LOAD_UINT32_REVERSED((UINT32 *)p);
+            *p++ = t | (th << 32);
         } while (--iters);
     }
 }
diff -r 8c4396a1d3f9 -r b5b3b47a5917 doc/HACKS
--- a/doc/HACKS Wed Jun 15 04:33:52 2016 +0000
+++ b/doc/HACKS Wed Jun 15 05:01:58 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.169 2016/06/15 02:12:14 mrg Exp $
+# $NetBSD: HACKS,v 1.170 2016/06/15 05:01:58 mrg Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -635,18 +635,6 @@
                is broken.
        kcah
 
-       hack    gcc-5.3 arm and openssh and -fstrict-aliases
-       cdate   Tue Jun 14 19:05:51 PDT 2016
-       who     mrg
-       file    crypto/external/bsd/openssh/dist/umac.c : 1.10
-       pr      
-       descr   GCC has some yet-unknown code-gen problem on ARM with this
-               file that leads to SSH giving errors and dropping connections.
-               The bpw=8 path of endian_convert(), if compiled with
-               "no-strict-aliases" optimiser attribite, works.  The same
-               problem exist with GCC 5.3 and 5.4.
-       kcah
-
 port   sh3
 
        hack    gcc4-sh3-bz2



Home | Main Index | Thread Index | Old Index