Source-Changes-HG archive

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

[src/trunk]: src build convert_endian() with "no-strict-aliases" optimiser at...



details:   https://anonhg.NetBSD.org/src/rev/ccfabe4c6545
branches:  trunk
changeset: 345903:ccfabe4c6545
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Jun 15 02:12:14 2016 +0000

description:
build convert_endian() with "no-strict-aliases" optimiser attribute
to avoid some unknown miscompilation in endian_convert() that causes
ssh to exit on some output (for me, "cc -v".)

note in HACKS.  we should investigate this further if possible as
this seems to indicate a strict aliasing violation.  there certainly
are 32 and 64 bit object arrays being accessed with 8 bit accessors,
but i don't have time currently.

diffstat:

 crypto/external/bsd/openssh/dist/umac.c |   7 +++++--
 doc/HACKS                               |  14 +++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r 89362b2a8df5 -r ccfabe4c6545 crypto/external/bsd/openssh/dist/umac.c
--- a/crypto/external/bsd/openssh/dist/umac.c   Tue Jun 14 20:55:00 2016 +0000
+++ b/crypto/external/bsd/openssh/dist/umac.c   Wed Jun 15 02:12:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umac.c,v 1.9 2015/04/03 23:58:19 christos Exp $        */
+/*     $NetBSD: umac.c,v 1.10 2016/06/15 02:12:14 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.9 2015/04/03 23:58:19 christos Exp $");
+__RCSID("$NetBSD: umac.c,v 1.10 2016/06/15 02:12:14 mrg Exp $");
 #include <sys/types.h>
 #include <sys/endian.h>
 #include <string.h>
@@ -566,6 +566,9 @@
 /* ---------------------------------------------------------------------- */
 
 #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.     */
diff -r 89362b2a8df5 -r ccfabe4c6545 doc/HACKS
--- a/doc/HACKS Tue Jun 14 20:55:00 2016 +0000
+++ b/doc/HACKS Wed Jun 15 02:12:14 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.168 2016/06/04 11:25:43 joerg Exp $
+# $NetBSD: HACKS,v 1.169 2016/06/15 02:12:14 mrg Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -635,6 +635,18 @@
                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