This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: MIPS GCC always generates outline memcpy when optimizing for size?
- From: Steve Ellcey <sellcey at mips dot com>
- To: Anders Montonen <Anders dot Montonen at iki dot fi>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 4 Feb 2014 09:48:26 -0800
- Subject: Re: MIPS GCC always generates outline memcpy when optimizing for size?
- Authentication-results: sourceware.org; auth=none
- References: <BE7DCAAF-D1BF-4105-806F-5F9C810C161A at iki dot fi>
On Sun, 2014-02-02 at 14:19 +0200, Anders Montonen wrote:
> Hi,
>
> It seems that GCC configured for MIPS will always generate a call to memcpy when
> optimizing for size, is this expected behaviour? I have encountered this both with
> a self-built GCC 4.8.1 (configured for mipsel-sde-elf) and Microchip's XC32 compiler,
> which is based on GCC 4.5.2.
This is related to the MIPS -mmemcpy flag. Try using -mno-memcpy with
-Os and you should get inlined code for your __builtin_memcpy use.
Steve Ellcey