Message ID | mcrty23eelq.fsf@dhcp-172-18-216-180.mtv.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r 071257161dab libgo/runtime/go-type-identity.c --- a/libgo/runtime/go-type-identity.c Sun Mar 04 22:03:57 2012 -0800 +++ b/libgo/runtime/go-type-identity.c Sun Mar 04 22:36:37 2012 -0800 @@ -6,6 +6,7 @@ #include <stddef.h> +#include "config.h" #include "go-type.h" /* The 64-bit type. */ @@ -31,7 +32,11 @@ unsigned char a[8]; } u; u.v = 0; - __builtin_memcpy (&u.a, key, key_size); +#ifdef WORDS_BIGENDIAN + __builtin_memcpy (&u.a[8 - key_size], key, key_size); +#else + __builtin_memcpy (&u.a[0], key, key_size); +#endif if (sizeof (uintptr_t) >= 8) return (uintptr_t) u.v; else