This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Gfortran, Patch] PR12456 - Optimize single character.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]