diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-07-25 23:21:20 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-07-25 23:21:20 +0000 |
commit | 722c33bbb6d2984cf537f0d3669617fba041fb50 (patch) | |
tree | 2a7f596c5e9979123c3833a1684a2d3516c067f9 /sysdeps/i386/bits | |
parent | 788e8e7c221825916e6ab11f0079d4c5ede8a057 (diff) | |
download | glibc-722c33bbb6d2984cf537f0d3669617fba041fb50.tar.gz glibc-722c33bbb6d2984cf537f0d3669617fba041fb50.tar.xz glibc-722c33bbb6d2984cf537f0d3669617fba041fb50.zip |
Update.
* string/bits/string2.h: Fix aliasing problems. * sysdeps/i386/i486/bits/string.h: Likewise. * sysdeps/i386/bits/string.h: Likewise. 1998-12-28 Geoff Keating <geoffk@ozemail.com.au> * sysdeps/powerpc/dl-machine.c: Handle shared library profiling. * elf/rtld.c (dl_main): Don't call malloc() between re-relocating the dynamic linker and running the application's crt0. 1999-07-21 Paul D. Smith <psmith@gnu.org> * sysdeps/generic/glob.c: Move getlogin{,_r} prototypes below glob.h to get __P() macro. * posix/fnmatch.c (internal_fnmatch): Use K&R definition syntax, not ANSI. (__strchrnul): This won't exist outside GLIBC, so create one. 1999-07-25 Jakub Jelinek <jj@ultra.linux.cz> * sysdeps/unix/sysv/linux/sparc/bits/types.h: Always define __qaddr_t. __ino64_t should be 32bit unsigned type on sparc32. Define __off64_t to __quad_t instead of __int64_t. Make __pic_pid_t unsigned on sparc32. 1999-07-25 Andreas Jaeger <aj@arthur.rhein-neckar.de> * localedata/tst-rpmatch.sh: Use "&" instead of "§" to avoid a bug in bash 2.03. 1999-07-25 Ulrich Drepper <drepper@cygnus.com>
Diffstat (limited to 'sysdeps/i386/bits')
-rw-r--r-- | sysdeps/i386/bits/string.h | 92 |
1 files changed, 52 insertions, 40 deletions
diff --git a/sysdeps/i386/bits/string.h b/sysdeps/i386/bits/string.h index 1ea0571680..5f4f58a6db 100644 --- a/sysdeps/i386/bits/string.h +++ b/sysdeps/i386/bits/string.h @@ -54,59 +54,65 @@ __STRING_INLINE void * __memcpy_c (void *__dest, __const void *__src, size_t __n) { register unsigned long int __d0, __d1, __d2; + union { + unsigned int __ui; + unsigned short int __usi; + unsigned char __uc; + } *__u = __dest; switch (__n) { case 0: return __dest; case 1: - *(unsigned char *) __dest = *(const unsigned char *) __src; + __u->__uc = *(const unsigned char *) __src; return __dest; case 2: - *(unsigned short int *) __dest = *(const unsigned short int *) __src; + __u->__usi = *(const unsigned short int *) __src; return __dest; case 3: - *(unsigned short int *) __dest = *(const unsigned short int *) __src; - *(2 + (unsigned char *) __dest) = *(2 + (const unsigned char *) __src); + __u->__usi = *(const unsigned short int *) __src; + __u = (void *) __u + 2; + __u->__uc = *(2 + (const unsigned char *) __src); return __dest; case 4: - *(unsigned long int *) __dest = *(const unsigned long int *) __src; + __u->__ui = *(const unsigned int *) __src; return __dest; - case 6: /* for ethernet addresses */ - *(unsigned long int *) __dest = *(const unsigned long int *) __src; - *(2 + (unsigned short int *) __dest) = - *(2 + (const unsigned short int *) __src); + case 6: + __u->__ui = *(const unsigned int *) __src; + __u = (void *) __u + 4; + __u->__usi = *(2 + (const unsigned short int *) __src); return __dest; case 8: - *(unsigned long int *) __dest = *(const unsigned long int *) __src; - *(1 + (unsigned long int *) __dest) = - *(1 + (const unsigned long int *) __src); + __u->__ui = *(const unsigned int *) __src; + __u = (void *) __u + 4; + __u->__ui = *(1 + (const unsigned int *) __src); return __dest; case 12: - *(unsigned long int *) __dest = *(const unsigned long int *) __src; - *(1 + (unsigned long int *) __dest) = - *(1 + (const unsigned long int *) __src); - *(2 + (unsigned long int *) __dest) = - *(2 + (const unsigned long int *) __src); + __u->__ui = *(const unsigned int *) __src; + __u = (void *) __u + 4; + __u->__ui = *(1 + (const unsigned int *) __src); + __u = (void *) __u + 4; + __u->__ui = *(2 + (const unsigned int *) __src); return __dest; case 16: - *(unsigned long int *) __dest = *(const unsigned long int *) __src; - *(1 + (unsigned long int *) __dest) = - *(1 + (const unsigned long int *) __src); - *(2 + (unsigned long int *) __dest) = - *(2 + (const unsigned long int *) __src); - *(3 + (unsigned long int *) __dest) = - *(3 + (const unsigned long int *) __src); + __u->__ui = *(const unsigned int *) __src; + __u = (void *) __u + 4; + __u->__ui = *(1 + (const unsigned int *) __src); + __u = (void *) __u + 4; + __u->__ui = *(2 + (const unsigned int *) __src); + __u = (void *) __u + 4; + __u->__ui = *(3 + (const unsigned int *) __src); return __dest; case 20: - *(unsigned long int *) __dest = *(const unsigned long int *) __src; - *(1 + (unsigned long int *) __dest) = - *(1 + (const unsigned long int *) __src); - *(2 + (unsigned long int *) __dest) = - *(2 + (const unsigned long int *) __src); - *(3 + (unsigned long int *) __dest) = - *(3 + (const unsigned long int *) __src); - *(4 + (unsigned long int *) __dest) = - *(4 + (const unsigned long int *) __src); + __u->__ui = *(const unsigned int *) __src; + __u = (void *) __u + 4; + __u->__ui = *(1 + (const unsigned int *) __src); + __u = (void *) __u + 4; + __u->__ui = *(2 + (const unsigned int *) __src); + __u = (void *) __u + 4; + __u->__ui = *(3 + (const unsigned int *) __src); + __u = (void *) __u + 4; + __u->__ui = *(4 + (const unsigned int *) __src); return __dest; } #define __COMMON_CODE(x) \ @@ -115,7 +121,7 @@ __memcpy_c (void *__dest, __const void *__src, size_t __n) "rep; movsl" \ x \ : "=&c" (__d0), "=&D" (__d1), "=&S" (__d2) \ - : "0" (__n / 4), "1" (__dest), "2" (__src) \ + : "0" (__n / 4), "1" (&__u->__uc), "2" (__src) \ : "memory"); switch (__n % 4) @@ -184,22 +190,28 @@ __STRING_INLINE void * __memset_cc (void *__s, unsigned long int __pattern, size_t __n) { register unsigned long int __d0, __d1; + union { + unsigned int __ui; + unsigned short int __usi; + unsigned char __uc; + } *__u = __s; switch (__n) { case 0: return __s; case 1: - *(unsigned char *) __s = __pattern; + __u->__uc = __pattern; return __s; case 2: - *(unsigned short int *) __s = __pattern; + __u->__usi = __pattern; return __s; case 3: - *(unsigned short int *) __s = __pattern; - *(2 + (unsigned char *) __s) = __pattern; + __u->__usi = __pattern; + __u = __extension__ ((void *) __u + 1); + __u->__uc = __pattern; return __s; case 4: - *(unsigned long *) __s = __pattern; + __u->__ui = __pattern; return __s; } #define __COMMON_CODE(x) \ @@ -208,7 +220,7 @@ __memset_cc (void *__s, unsigned long int __pattern, size_t __n) "rep; stosl" \ x \ : "=&c" (__d0), "=&D" (__d1) \ - : "a" (__pattern), "0" (__n / 4), "1" (__s) \ + : "a" (__pattern), "0" (__n / 4), "1" (&__u->__uc) \ : "memory") switch (__n % 4) |