android_kernel_motorola_sm6225/arch/cris/arch-v10/lib
Jesper Nilsson 77a746cec5 cris: import memset.c from newlib: fixes compile error with newer (pre4.3) gcc
Adrian Bunk reported the following compile error with a SVN head GCC:

...
CC arch/cris/arch-v10/lib/memset.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c: In function 'memset':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:164: error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:165: error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:166: error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:167: error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:185: error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:189: error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/memset.c:192: error: lvalue required as increment operand
... etc ...

This is due to the use of the construct:

	*((long*)dst)++ = lc;

Which is no longer legal since casts don't return an lvalue.

The solution is to import the implementation from newlib,
which is continually autotested together with GCC mainline,
and uses the construct:

	*(long *) dst = lc; dst += 4;

With this change, the generated code actually shrinks 76 bytes
since gcc notices that it can use autoincrement for the move
instruction in CRIS.

   text    data     bss     dec     hex filename
    304       0       0     304     130 memset.old.o
   text    data     bss     dec     hex filename
    228       0       0     228      e4 memset.o

Since this is an import of a file from newlib, I'm not touching
the formatting or correcting any checkpatch errors.

Note also that even if the two files for the CRIS v10 and CRIS v32
are identical at the moment, it might be possible to tweak the
CRIS v32 version. Thus, I'm not yet folding them into the same file,
at least not until we've done some research on it.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-14 20:58:04 -08:00
..
checksum.S CRIS v10: Remove duplicated folding of carry from lib/checksum.S, it is not needed. 2008-02-08 11:06:32 +01:00
checksumcopy.S CRIS v10: Remove duplicated folding of carry from lib/checksumcopy.S, it is not needed. 2008-02-08 11:06:32 +01:00
csumcpfruser.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dmacopy.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dram_init.S CRIS v10: Remove useless CVS id and log from lib/dram_init.S 2008-02-08 11:06:31 +01:00
hw_settings.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
memset.c cris: import memset.c from newlib: fixes compile error with newer (pre4.3) gcc 2008-02-14 20:58:04 -08:00
old_checksum.c CRIS v10: Remove useless CVS id tag from lib/old_checksum.c 2008-02-08 11:06:31 +01:00
string.c CRISv10 string library add lineendings to asm 2007-11-14 18:45:47 -08:00
usercopy.c CRISv10 usercopy library add lineendings to asm 2007-11-14 18:45:47 -08:00