[gfortran,patch] Don't call library function for string copying, take 2

Jakub Jelinek jakub@redhat.com
Tue Jul 11 11:06:00 GMT 2006


On Tue, Jul 11, 2006 at 12:37:57PM +0200, THOMAS Paul Richard 169137 wrote:
> This being the case, it would be as well to get rid of the call to memmove.
> If removing one level of function call improves matters so much, I guess
> that getting rid of the second level will achieve at least the same again.
> Not only is memmove purported to be slow but, there is potentially a call
> to memset to be eliminated too.

GCC knows about the memcpy/memmove builtins and optimizes them where
possible/desirable.  If that is not working well, you should try to improve
the memcpy/memmove builtin optimizations in the middle-end rather than
open code memmove or memcpy on your own.

All that the Fortran FE could do is if it can prove that the memories don't
overlap AND the proof of this is something that Fortran specific and lost
after the conversion to GIMPLE, then the FE should insert memcpy builtin
rather than memmove and let builtins.c do its job.

	Jakub



More information about the Gcc-patches mailing list