i386 GCC-3.4 & Mandrake-9.2 GCC-3.3.1 non-inline memset/memcpy

Etienne Lorrain etienne_lorrain@yahoo.fr
Tue Nov 4 23:09:00 GMT 2003


> Honza wrote:
> ...  So you either need to use memcpy/memset or you can
> use -Os/-march=i386 that will result in rep;mov[lb] as well.

  I have just tryed again.
  The option -minline-all-stringops solved the problem for
 Mandrake-9.2 GCC-3.3.1 , but I still have some memcpy when
 using GCC-3.4-pre. No more memset in neither compiler.

 How to reproduce: download gujin-0.8.tgz at:
http://prdownloads.sourceforge.net/gujin/gujin-0.8.tgz?download
 Download gcc-core-3.4-20031015.tar.bz2 and binutils-2.14.tar.bz2
 from your usual mirror.
tar -xzf gujin-0.8.tgz
cd gujin
make toolchain   # takes a long time...
make dep user.o CFLAGS=-minline-all-stringops

  So at end of the log:

/home/etienne/projet/toolchain/bin/gcc -minline-all-stringops -include
code16.h -DDEBUG="(DEBUG_STACK)"
-DUSER_SUPPORT="(VGA_SUPPORT|VGA_EXTENDED|VESA_WINDOW|VESA_WINFUNCTION|VESA_LINEAR|VESA_EDID|VESA_RECALC|VESA_2WINDOWS|VESA_HARDWINDOW|VESA_PMINFO|VESA_16BPP|VESA_32BPP|VESA_24BPP|VESA_4BPP_EGA|VESA_4BPP_TEXT|VESA_8BPP|SERIAL_VT100|SERIAL_VT420|BIOS_MOUSE_SUPPORT|SERIAL_MOUSE_SUPPORT|JOYSTICK_SUPPORT)"
-DDISK_SUPPORT="(BIOS_SUPPORT|EBIOS_SUPPORT|IDE_SUPPORT|DOS_SUPPORT|E2FS_PROBE|FAT12_PROBE|FAT16_PROBE|FAT32_PROBE|BOOTSECT_PROBE)"
-DSETUP="(CODE_SEGMENT|XCODE_SEGMENT|XDATA_SEGMENT|ASSEMBLY_CISC|UPDATE_BOOTPARAM|USE_INT1587)"
-DLANGUAGE=ENGLISH  -fomit-frame-pointer -march=i386 -mrtd -fno-builtin
-funsigned-char -fno-schedule-insns2 -finline-limit=10000 -Os
-ffunction-sections -fstrict-aliasing -falign-loops=1 -falign-jumps=1
-falign-functions=2  -mno-align-double -mpreferred-stack-boundary=2 -Wall
-Wno-format -Wno-main -Wstrict-prototypes -Wundef -Wpointer-arith
-Wcast-align -Wwrite-strings -Wsign-compare -Wdisabled-optimization -S -o
user.S user.c
sed '/.align 32/d' < user.S > user.s
/home/etienne/projet/toolchain/bin/as  -acdhls=user.lis -o user.o user.s
rm user.S user.s
[etienne@localhost gujin]$ grep memcpy user.lis
 5303 0053 66E8FCFF             call    memcpy
 5722 003b FC                           cld     # _memcpy modify memory
 6009 044c 66E8FCFF             call    memcpy
 6042 04e1 66E8FCFF             call    memcpy
 6462 03b1 FC                           cld     # _memcpy modify memory
 6705 0730 FC                           cld     # _memcpy modify memory
 7577 00e1 FC                   cld             # lmemcpy modify memory
 7853 0106 66E8FCFF             call    memcpy
 7943 0219 66E8FCFF             call    memcpy
 8159 04e5 66E8FCFF             call    memcpy
 9050 0058 66E8FCFF             call    memcpy
 9054 006d 66E8FCFF             call    memcpy
 9360 00ec FC                   cld             # lmemcpy modify memory
memcpy
[etienne@localhost gujin]$ grep memcpy user.c
      /* copy from high to low memory, no memcpy! */
      lmemcpy (&tmpstatictable, tmptable.static_functionality_table,
  /* NO memcpy/memset here, %es is not initialised */
  memcpy (compressed_array, long_array, sizeof (compressed_array));
  memcpy (long_array, compressed_array, sizeof (compressed_array));
  lmemcpy (UI.info.vesa.cardname, vesainfo.OemStringPtr,
[etienne@localhost gujin]$

  i.e. I have two explicit call to memcpy (which are handled by one
 inline function of mine) but a lot more have been generated by
 copying structure. The option contain:
-minline-all-stringops -march=i386 -Os

  Etienne.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



More information about the Gcc mailing list