This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Gfortran, Patch] PR12456 - Optimize single character.
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Feng Wang <wf_cs at yahoo dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 05 Jan 2006 00:40:28 +0100
- Subject: Re: [Gfortran, Patch] PR12456 - Optimize single character.
- References: <20060104044026.95012.qmail@web15607.mail.cnb.yahoo.com>
Feng Wang wrote:
> :ADDPATCH fortran:
>
> This patch fix PR12456. If a string's length is 1, we convert it to a single
> character. This will optimize string copy, string compare, including related
> intrinsic functions.
>
> ChangeLog entry:
>
> 2006-01-04 Feng Wang <fengwang@nudt.edu.cn>
>
> PR fortran/12456
> * trans-expr.c (gfc_to_single_character): Convert string to single
> character if its length is 1.
> (gfc_conv_expr_op): Use it.
> (gfc_trans_string_copy): Use it.
> * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use it.
> * trans.h (gfc_to_single_character): Add prototype.
>
> Testsuite ChangeLog:
>
> 2006-01-04 Feng Wang <fengwang@nudt.edu.cn>
>
> PR fortran/12456
> * gfortran.dg/pr12456.f90: New test.
I don't mind Andrew approving patches, I'm just wondering if you can actually
verify that your patch has the desired effect, e.g. by scanning the assembler
output for the string library routines, and making sure that they're not called.
- Tobi