This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/11787] New: always call memcpy for block move in mips16
- From: "stephane dot mutz at philips dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2003 13:23:54 -0000
- Subject: [Bug target/11787] New: always call memcpy for block move in mips16
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11787
Summary: always call memcpy for block move in mips16
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: stephane dot mutz at philips dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips-uclibc-gnu
The compiler always generates a call to memcpy() for internally or manually
generated block moves even for very small blocks (few bytes) when compiling for
mips16.
1)How to reproduce:
source code: essai.c
int main ()
{ memcpy ( 0x8fc01000, 0x8fc02000, 2);
memcpy ( 0x8fc01000, 0x8fc02000, 20);
memcpy ( 0x8fc01000, 0x8fc02000, 200);
memcpy ( 0x8fc01000, 0x8fc02000, 2000);
}
gcc -O2 -mips16 -S essai.c
result asm: essai.s
.file 1 "essai.c"
.section .mdebug.abi32
.previous
.abicalls
.set mips16
.text
.align 2
.globl main
.ent main
.type main, @function
main:
.frame $sp,40,$31 # vars= 0, regs= 4/0, args= 16, extra= 8
.mask 0x90030000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set reorder
subu $sp,$sp,40
.cprestore 16
sw $17,28($sp)
sw $16,24($sp)
lw $17,$LC1
lw $16,$LC0
move $2,$28
move $4,$16
move $5,$17
li $6,2
sw $31,36($sp)
sw $2,32($sp)
la $25,memcpy
jal $3,$25
move $4,$16
move $5,$17
li $6,20
la $25,memcpy
jal $3,$25
move $4,$16
move $5,$17
li $6,200
la $25,memcpy
jal $3,$25
move $4,$16
move $5,$17
li $6,2000
la $25,memcpy
jal $3,$25
lw $7,36($sp)
lw $17,28($sp)
lw $16,24($sp)
#nop
move $3,$sp
addu $3,40
move $sp,$3
j $7
.end main
.align 2
$LC0:
.word -1883238400
.align 2
$LC1:
.word -1883234304
.ident "GCC: (GNU) 3.3"
2)Build platform
lxws005:/user/mutz/build/profiler> mips-uclibc-gcc --verbose -S essai.c
Reading specs from /user/mutz/mips/lib/gcc-lib/mips-linux/3.3/specs
Configured with: /user/mutz/build/build_mips/gcc-3.3/configure --target=mips-
linux --prefix=/user/mutz/mips --exec-prefix=/user/mutz/mips --
bindir=/user/mutz/mips/bin --sbindir=/user/mutz/mips/sbin --
sysconfdir=/user/mutz/mips/etc --datadir=/user/mutz/mips/share --
localstatedir=/user/mutz/mips/var --mandir=/user/mutz/mips/man --
infodir=/user/mutz/mips/info --with-local-prefix=/user/mutz/mips/usr/local --
libdir=/user/mutz/mips/lib --includedir=/user/mutz/mips/include --with-gxx-
include-dir=/user/mutz/mips/include/c++ --
oldincludedir=/user/mutz/mips/include --enable-shared --enable-target-optspace -
-disable-nls --with-gnu-ld --disable-__cxa_atexit --enable-languages=c,c++ --
program-prefix=mips-uclibc-
Thread model: posix
gcc version 3.3
/user/mutz/mips/lib/gcc-lib/mips-linux/3.3/cc1 -quiet -v -D__GNUC__=3 -
D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 essai.c -quiet -dumpbase essai.c -
auxbase essai -version -o essai.s
GNU C version 3.3 (mips-linux)
compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64237
ignoring duplicate directory "/user/mutz/mips/mips-linux/sys-include"
ignoring duplicate directory "/user/mutz/mips/mips-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/user/mutz/mips/include
/user/mutz/mips/lib/gcc-lib/mips-linux/3.3/include
End of search list.
essai.c: In function `main':
essai.c:3: warning: passing arg 1 of `memcpy' makes pointer from integer
without a cast
essai.c:3: warning: passing arg 2 of `memcpy' makes pointer from integer
without a cast
essai.c:5: warning: passing arg 1 of `memcpy' makes pointer from integer
without a cast
essai.c:5: warning: passing arg 2 of `memcpy' makes pointer from integer
without a cast
essai.c:7: warning: passing arg 1 of `memcpy' makes pointer from integer
without a cast
essai.c:7: warning: passing arg 2 of `memcpy' makes pointer from integer
without a cast
essai.c:9: warning: passing arg 1 of `memcpy' makes pointer from integer
without a cast
essai.c:9: warning: passing arg 2 of `memcpy' makes pointer from integer
without a cast
lxws005:/user/mutz/build/profiler> uname -a
Linux lxws005 2.4.18-5Caen #4 Wed Aug 14 17:05:20 CEST 2002 i686 unknown
3)Other info
Also reproduce on GCC 3.2.2 mips cross-compiler on HP and linux platform