[Gfortran, Patch] PR12456 - Optimize single character.
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Wed Jan 4 23:40:00 GMT 2006
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
More information about the Gcc-patches
mailing list