On Tue, Dec 16, 2008 at 05:36:32PM -0800, v...@uclibc.org wrote: >Author: vda >Date: 2008-12-16 17:36:31 -0800 (Tue, 16 Dec 2008) >New Revision: 24435 > >Log: >since gcc -Os hates us and does not inline string ops,
I don't remember offhand if we deliberately turned them off. >implement inline versions of some of them. >Enable only those which result roughly in the same >code size as using out-or-line versions. > >None of this affects users, installed headers won't have >any trace of it. >+static __always_inline >+void *inlined_memchr_const_c(const void *s, int c, size_t count) >+{ >+ void *edi; >+ int ecx, eax; >+ __asm__ __volatile__( >+ " jecxz 1f\n" >+ " movb %4, %%al\n" /* const c to %%al */ >+ " repne; scasb\n" >+ " leal -1(%%edi), %%edi\n" >+ " je 2f\n" >+ "1:\n" >+ " xorl %%edi, %%edi\n" >+ "2:\n" >+ : "=&D" (edi), "=&c" (ecx), "=&a" (eax) >+ : "0" (s), "i" (c), "1" (count) >+ /* : no clobbers */ >+ ); Are you sure? Sounds like there is a bug somewhere for it works with any optimization level on gcc 4.4 as opposed to anything earlier: gcc -c libc/stdio/_fwrite.c -o libc/stdio/_fwrite.os -include ./include/libc-symbols.h -Wall -Wstrict-prototypes -fno-strict-aliasing -Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wnonnull -Wundef -funsigned-char -fno-builtin -fno-asm -std=gnu99 -ffunction-sections -fdata-sections -m32 -fstack-protector -nostdinc -I./include -I. -I./libc/sysdeps/linux/i386 -DUCLIBC_INTERNAL -O0 -g3 -I./libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386 -I./libpthread/linuxthreads/sysdeps/i386 -I./libpthread/linuxthreads/sysdeps/unix/sysv/linux -I./libpthread/linuxthreads/sysdeps/pthread -I./libpthread/linuxthreads -I./libpthread -I/usr/include/ -I/usr/lib/gcc/i486-linux-gnu/4.3.3/include-fixed -I/usr/lib/gcc/i486-linux-gnu/4.3.3/include -DNDEBUG -DMALLOC_DEBUGGING -DHEAP_DEBUGGING -fPIC -MT libc/stdio/_fwrite.os -MD -MP -MF libc/stdio/._fwrite.os.dep ./include/libc-string_i386.h: In function '__stdio_fwrite': ./include/libc-string_i386.h:293: warning: asm operand 4 probably doesn't match constraints ./include/libc-string_i386.h:293: error: impossible constraint in 'asm' >+ return edi; >+} _______________________________________________ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc