[patch, fortran] PR 47065 - some more trim optimizations

Thomas Koenig tkoenig@netcologne.de
Sun Feb 20 14:05:00 GMT 2011


Hello world,

the attached patch does the trim optimizations when there are
references, except substring references.  This was made possible by
Paul's fix to PR 47348.  Regression-tested.

OK for trunk?  Or should I rather wait until 4.6 is released?

2011-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/47065
        * frontend-passes (check_impure_function): New function.
        * optimize_trim: Also follow references, except when they are
        substring references.  Don't replace calls to trim with substrings
        if the substring indices contain impure functions.

2011-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/47065
        * gfortran.dg/trim_optimize_5.f90:  New test.
        * gfortran.dg/trim_optimize_6.f90:  New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p3.diff
Type: text/x-patch
Size: 4055 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110220/537882cd/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: trim_optimize_5.f90
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110220/537882cd/attachment.f90>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: trim_optimize_6.f90
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110220/537882cd/attachment-0001.f90>


More information about the Gcc-patches mailing list