This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran,patch] PR fortran/28163: Don't call library function for string copying
- From: Bernhard Fischer <rep dot nop at aon dot at>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 25 Jun 2006 14:59:29 +0200
- Subject: Re: [gfortran,patch] PR fortran/28163: Don't call library function for string copying
- References: <449E8545.3090009@gmail.com>
On Sun, Jun 25, 2006 at 02:44:53PM +0200, FX Coudert wrote:
>:ADDPATCH fortran:
>
>Currently, gfortran generates library calls for string copying. This is
>a major performance bottleneck: removing it and replacing these calls by
>direct code and calls to memmove/memset, as does the attached patch,
>gives a 27% speedup in execution time for aermod (from the polyhedron
>benchmark).
>
>I'd welcome a careful review of this patch. In particular, I think the
>following lines
>
>+ tmp4 = gfc_chainon_list (tmp4, build_int_cst
>+ (gfc_get_int_type (gfc_c_int_kind), ' '));
>
>are wrong for cross-compilers, as the host ' ' may not be the same as
>the target ' '. But I don't know how to do anything better, so I'd
>welcome hints on this one.
>
>Bootstrapped and regtested on i686-linux.
>
>OK for mainline?
I'm curious if this should be selectable via something like
-minline-all-stringops resp. -f{no-}builtin-whatever?
While it may give a nice performance boost, it most likely is something
e.g. -Os doesn't like, fwiw.